我在 datagridview 中有一个单元格,它位于第 8 行第 2 列 该单元格和该单元格仅在单击时我想显示为另存为对话框,但实际上我可以让特定单元格发生单击事件,我该如何执行此操作vb.net?
在 dataGridView 事件“DataGridView1_CellClick”中添加以下代码:
Private Sub DataGridView1_CellClick(sender As Object, e As DataGridViewCellEventArgs) Handles DataGridView1.CellClick
If e.ColumnIndex = 2 And e.RowIndex = 8 Then
'Do any thing
MsgBox("yes" + DataGridView1.Item(e.ColumnIndex, e.RowIndex).Value.ToString())
End If
End Sub
本文内容由网友自发贡献,版权归原作者所有,本站不承担相应法律责任。如您发现有涉嫌抄袭侵权的内容,请联系:hwhale#tublm.com(使用前将#替换为@)