datagridview vb.net中特定单元格的单击事件 [英] Click event for specific cell in datagridview vb.net

查看:214
本文介绍了datagridview vb.net中特定单元格的单击事件的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我在datagridview中有一个单元格,该单元格位于第8行第二列。该单元格和该单元格只有在单击时才想显示为另存为对话框,但实际上我可以得到特定单元格发生的点击事件,我该怎么办

I have a cell in a datagridview its located at the 8th row 2nd column That cell and that cell only if clicked I want to show as save as dialoguebox but I can actually get a click event happening for a specific cell how do I do this in vb.net?

推荐答案

在您的dataGridView事件 DataGridView1_CellClick中添加此代码:

In you dataGridView Event "DataGridView1_CellClick" add this code :

  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

这篇关于datagridview vb.net中特定单元格的单击事件的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
相关文章
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆