Warning: file_get_contents(/data/phpspider/zhask/data//catemap/2/image-processing/2.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
返回vb.net中的get datagridview单元格值_Vb.net - Fatal编程技术网

返回vb.net中的get datagridview单元格值

返回vb.net中的get datagridview单元格值,vb.net,Vb.net,我试图在单击datagridview单元格时返回该单元格中包含的值。有谁能告诉我如何使用vb.net实现这一点吗?谢谢查看此示例代码。关键是使用事件的DataGridViewCellEventArgs参数查找单击单元格的RowIndex和ColumnIndex Private Sub DataGridView1_CellClick(ByVal sender As System.Object, _ ByVal e As Dat

我试图在单击datagridview单元格时返回该单元格中包含的值。有谁能告诉我如何使用vb.net实现这一点吗?谢谢查看此示例代码。关键是使用事件的
DataGridViewCellEventArgs
参数查找单击单元格的
RowIndex
ColumnIndex

Private Sub DataGridView1_CellClick(ByVal sender As System.Object, _
                                    ByVal e As DataGridViewCellEventArgs) _
                                    Handles DataGridView1.CellClick
    MsgBox(DataGridView1.Rows(e.RowIndex).Cells(e.ColumnIndex).Value)
End Sub

你可以按一下按钮打电话

Dim y As String = DataGridView1.CurrentCell.Value

If IsDBNull(y) Then

Else

TextBox1.Text = y

End If

附言:如果你真的费心去标注对你帮助最大的答案,你可能会得到更多的答案——声誉是回答你的人唯一的回报。