Using VB 2008. I have a form with a text box and a button on it. The button displays another form with a datagridview from which I want the user to select from to populate the text box. On RowHeaderMouseClick, I populate the text box field from the first form with the value of the first cell in the selected row, then hide the second form, mission accomplished. However, the way I am assigning the value seems extremely hokey (wordy). Is there a better way to do this?
The line of code is:

Form4.TextBox1.Text = DoctorsDataGridView.CurrentRow.Cells(0).Value.ToString

Seems kinda roundabout to me, but... it works so maybe I should just shut up?
Bill P.

Hmm... no comments and it works, so I guess I'll just shut up. Ha.

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.