getting the properties of selected item in textBoxes HELP!?

BlueOysterCult

Well-known member
Joined
Oct 3, 2003
Messages
84
Hello everyone

I havent a clue as to how ...

to get a selected items "features" ie if someone selects a car from the list (ListBox) 2004 Chevy S-10 into the provided text boxes for those features. The features being air conditoining, color etc. So if I were to select the chevy.. the text boxes would list those features> the text box for air cond would have the value "true" > the text box would have the value "red"

I am lost with this one. Can someone give me an idea?

am I over explaining it?


Thanks


Rob
 
I kind of want to do something like this:(?)
Code:
   Public Sub FillTextBoxes(ByVal sender As System.Object, ByVal e As System.EventArgs)

        Dim index As Integer = CarArrayList(0)
        Dim intCurrent As Integer
        intCurrent = (0)

        If index <> -1 Then
            txtPrice.Text = CarArrayList(2)
            txtMake.Text = CarArrayList(intCurrent)
            txtYear.Text = CarArrayList(intCurrent)
            txtIntColor.Text = CarArrayList(intCurrent)
            txtExtColor.Text = CarArrayList(intCurrent)

        End If

    End Sub

Rob
 
Im assumming that there are several list boxes that are using this sub and not just one.
Im not at a VB.Net site but try this.

Code:
Public Sub FillTextBoxes(ByVal ctrl as Control)
If ctrl.SelectedIndex < 0 Then Exit Sub
txtPrice.Text = CarArrayList(2)
txtMake.Text = CarArrayList(ctrl.SelectedIndex)
etc...
End Sub

Then call the sub from the list boxes selected index changed event...
FillTextBoxes(DirectCast(sender, ListBox))

I think that should work...
Dan
 
Thanks DiverDan
I actually have a 1 comboBox (sorry)- I am able to display the list of cars to choose from - there are 11 in the array. Does that make a difference?

R
 
Yes, it does.

I think youre going to need a series of arrays for this.

1. Car manufactures - Manufactures()
2. The manufactures Models - GM(x, y) & Ford(x, y) etc.

where (x) are the models & years and (y) are the features.

The various paint choices can be in a csv format in a section of the array and broken out when needed.

without getting too deep into this I think that will give you an idea.

Is this close to want you are doing?
 
Back
Top