我有一个 DataGridView,其中包含来自包含数据的数据库文件的单元格。基本上,我想从 DataGridView 中的选定单元格中获取文本,并在单击按钮时将其显示在文本框中。按钮点击事件的代码是:
Private Sub Button1_Click(ByVal sender As Object, ByVal e As System.EventArgs) Handles Button1.Click
Dim SelectedThings As String = DataGridView1.SelectedCells.ToString
TextBox1.Text = SelectedThings
End Sub
但是在TextBox1我得到:
System.Windows.Forms.DataGridViewSelectedCellCollection
我想这并不像看起来那么简单。我是一名刚刚学习 VB.NET 的 C 开发人员。