PNRT
asked on
VB.Net2 Change text on individual button in Datagridview
Hi Experts. I have a datagridview with a column of buttons that all start off with the text "Off".
I want to be able to change the text to "On" when the button is pressed and back to "Off when pressed again. So some will say "Off" and Some "On". Please could someone help with an example of how this could be done?
I will also need to get the condition of the button later, whether its text is "Off" or "On". Help there would also be appreciated. Many Thanks for the help
I want to be able to change the text to "On" when the button is pressed and back to "Off when pressed again. So some will say "Off" and Some "On". Please could someone help with an example of how this could be done?
I will also need to get the condition of the button later, whether its text is "Off" or "On". Help there would also be appreciated. Many Thanks for the help
ASKER
Thanks for the reply Codecruiser, but how do I get the button click of the button in the particular row of the datagridview. I can see how to do it with a normal button but I need to do it with the individual buttons in the datagridview column. Thanks again.
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Button1_Click:
Button1.Tag = Not Button1.Tag
If Button1.Tag Then
Button1.Text = "On"
Else
Button1.Text = "Off"
End If