Dim s As String = DataGridView1.SelectedRow(0).Cells(0).Value.ToString() + "," + DataGridView1.SelectedRow(0).Cells(1).Value.ToString()
ClipBoard.SetText(s)
Dim rowscount As Integer = DataGridView1.RowCount '数据行数 Dim i As Integer For i = 0 To rowscount - 1 DataGridView1.Rows(i).Cells(0).Selected = True DataGridView1.Rows(i).Cells(2).Selected = True Next Clipboard.SetDataObject(DataGridView1.GetClipboardContent) '复制到剪切板
Dim s As String = DataGridView1.SelectedRow(0).Cells(0).Value.ToString() + "," + DataGridView1.SelectedRow(0).Cells(1).Value.ToString()
ClipBoard.SetText(s)
#2
有一个DataGridview表格数据,如何把第1、3列数据复制到剪切板?
2万行的数据慢如牛呀!
#3
Dim s As String = DataGridView1.SelectedRow(0).Cells(0).Value.ToString() + "," + DataGridView1.SelectedRow(0).Cells(1).Value.ToString()
ClipBoard.SetText(s)
Dim rowscount As Integer = DataGridView1.RowCount '数据行数 Dim i As Integer For i = 0 To rowscount - 1 DataGridView1.Rows(i).Cells(0).Selected = True DataGridView1.Rows(i).Cells(2).Selected = True Next Clipboard.SetDataObject(DataGridView1.GetClipboardContent) '复制到剪切板