vb.net DataGridView中粘贴的问题解决-还是有问题待解决

本文探讨了在VB.NET中遇到的DataGridView控件粘贴问题,并分享了解决方案的代码片段,但指出仍有未解决的问题待进一步探讨。

摘要生成于 C知道 ,由 DeepSeek-R1 满血版支持, 前往体验 >

今天晚上没事就给倒腾一下这个在DGV中的粘贴问题。以下是代码:

Public Class Form1

    Private Sub DataGridView1_CellClick(sender As Object, e As System.Windows.Forms.DataGridViewCellEventArgs) Handles DataGridView1.CellClick
        TextBox1.Text = "THIS IS " & IsNothing(DataGridView1.CurrentCell.Value)
        If IsNothing(DataGridView1.CurrentCell.Value) = False Then
            Dim L As String = DataGridView1.CurrentCell.Value.ToString
            For I As Int16 = 0 To L.Length - 1
                R.Text = Asc(L(I)) & vbCrLf
            Next
        Else
            R.Text = ""
        End If
    End Sub

    Private Sub DataGridView1_KeyUp(sender As Object, e As System.Windows.Forms.KeyEventArgs) Handles DataGridView1.KeyUp
        If e.Control And e.KeyCode = Keys.V Then
            If Clipboard.GetText <> "" Then
                Dim s() As String
                s = Clipboard.GetText.ToString.Split(ChrW(9)) '横向添加
                If s.Length > 0 Then
     
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值