Jump to content
Xtreme .Net Talk

Recommended Posts

Posted

Hello everyone

 

I haven't 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

Posted

I kind of want to do something like this:(?)


  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

  • *Experts*
Posted

I'm assumming that there are several list boxes that are using this sub and not just one.

I'm not at a VB.Net site but try this.

 

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

Member, in good standing, of the elite fraternity of mentally challenged programmers.

 

Dolphins Software

  • *Experts*
Posted

Yes, it does.

 

I think you're going to need a series of arrays for this.

 

1. Car manufactures - Manufactures()

2. The manufacture's 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?

Member, in good standing, of the elite fraternity of mentally challenged programmers.

 

Dolphins Software

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...