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.

9 Years
Discussion Span
Last Post by Bill Purkins
This question has already been answered. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.