Results 1 to 3 of 3

Thread: combo/listbox question

  1. #1

    Thread Starter
    Addicted Member
    Join Date
    Apr 2006
    Posts
    147

    combo/listbox question

    I have a combobox and a listbox and two textboxes (txtFruit and txtDrink)

    The listbox contains:
    Apples
    Bananas
    Oranges
    Pears

    The ComboBox contains:
    Tango
    Pepsi
    Juice
    MilkShake

    I need to say if the Banana is selected in the listbox then put that item in the txtFruit textbox and if the Milkshake is selected in the comboBox put that item in the txtDrink textBox and be able to choose just one item for each

    Any ideas/advise on how to do this?

  2. #2
    PowerPoster RhinoBull's Avatar
    Join Date
    Mar 2004
    Location
    New Amsterdam
    Posts
    24,135

    Re: combo/listbox question

    Thry the following:
    VB Code:
    1. Private Sub lstFruits_Click()
    2.     txtFruit.Text = lstFruits.List(lstFruits.ListIndex)
    3. End Sub
    4.  
    5. Private Sub cboDrinks_Click()
    6.     txtDrink.Text = cboDrinks.List(cboDrinks.ListIndex)
    7. End Sub

  3. #3

    Thread Starter
    Addicted Member
    Join Date
    Apr 2006
    Posts
    147

    Re: combo/listbox question

    Thanks mate - it works

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width