Question Grabbing info from listbox into textboxes.

gnxc

New member
Joined
May 10, 2009
Messages
4
Programming Experience
Beginner
Hey guys, i am currently working on a form that looks like this:

When i click on any textboxes under Plan Code, the plan form will pop up.
When i click on a field in lbType, field will appear in my lbCode.
When i click on a field lbCode, i want to be able to insert information into the textboxes.

The problem i have is that i can only get the form to work for the first row of textboxes. Because my code looks like -
VB.NET:
Private Sub lbcode_selectchanged(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles lbCode.DoubleClick
        addNewClientPolicy.TextBox1.Text = Me.lbCode.SelectedItem
        'addNewClientPolicy.TextBox17.Text = Me.lblText.Text
        addNewClientPolicy.TextBox25.Text = Me.lbType.SelectedItem
    End Sub

Is there anyway i can edit the code so that the information inserted into textboxes depends on which plancode textbox i click?
I know it'd be rather stupid to create 7 plan forms for each textbox :D

Thanks in advance!
 
Hey Robert,
Thanks for the reply, I'm not using DGV at the moment because i'm very unfamiliar with it and i feel that this part of my application will not require it :D
Regarding
VB.NET:
TryCast(Me.Controls($NameOfTheControlAsString), Label)
I do not really understand what this line does, exactly?

Cheers!
 
Last edited:
Back
Top