I would like to know what is the proper code in VB.Net with the logic of when I click the datagridview was click the Button2 will enable then the Button1 will disable and if I didn't click any cell on the datagridview the Buttons property will be alter or vice versa.
Here's the illustration.

Hi, you could use the cellclick event to do that, so when you click on any cell Button2 will enable and Button1 disable. To change that again something else will need to happen.

Private Sub DataGridView1_CellClick(sender As System.Object, e As System.Windows.Forms.DataGridViewCellEventArgs) Handles DataGridView1.CellClick
    Button1.Enabled = False
    Button2.Enabled = True
End Sub
Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.