Data Grid View Button handling - Change button.text

Tinshooter

Member
Joined
Oct 6, 2011
Messages
6
Programming Experience
1-3
Ok VB Gurus, I have a data grid view with 2 buttons, Start and End. Upon clicking the button, I want to change the button.text with a time stamp. I know how to create a time stamp, but I can't figure out how to change the text from "Start" to say for example "9:21 PM" Can anyone help? I hope I was clear enough.

So far I have:
If e.ColumnIndex <> 1 Then
The code to change the button.text, I am assuming would go here.
Dim tm As System.DateTime
tm = Now
 
Well, as of right now I have it set through the datagriview properties. But I want to manually change it with code after the buttonclick, It is very easy outside of a datagridview; I just can't figure out the syntax to do it inside of it.
 
That is exactly what I am trying to figure out, I can not seem to find any kind of syntax examples to do this.

I clearly understand how to do it with e textbox - txtTextbox.Text = ... But I am struggling with this because of the rows and columns.
 
I'm not sure you're actually trying to answer the question I asked. To change the contents of any cell you set its Value property. That's the question I asked, not how to get a reference to the cell in the first place. JohnH has now answered that question too.
 
Back
Top