今天晚上没事就给倒腾一下这个在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.Sp