4 Replies - 870 Views - Last Post: 20 June 2013 - 06:55 AM Rate Topic: -----

#1 d4rknitez  Icon User is offline

  • New D.I.C Head

Reputation: 0
  • View blog
  • Posts: 3
  • Joined: 19-June 13

ComboBox to ListBox Task

Posted 19 June 2013 - 09:19 PM

I'm Raj and from Malaysia. I want to link a listbox to a combobox. It's more like, when you click "Audi" in the combobox and a list of Audi cars shows in the listbox. I've struggled in these for a few days figuring it out. I've tried this code on change event of combobox but it doesn't work.

 If comboManufacturers.Text = "AUDI" Then
          listCars.Text = "A1" + "A1 Sportback + "A4 Saloon" + "A5 Coupe" + "A6 Saloon" + "A6 Hybrid" + "A7 Sportback" +             
          "A8 L" + "Q3" + "Q5" + "Q7" + "TT Coupe" + "R8 Coupe"



But this code doesn't work on Change and Click event. I've also added these car models in Form Load event.

 listCars.AddItem "A1"
       listCars.AddItem "A1 Sportback"
       listcars.AddItem "A4 Saloon"


and so on. I don't receive any errors though. Any suggestions or modifications?

This post has been edited by BobRodes: 21 June 2013 - 08:56 PM


Is This A Good Question/Topic? 0
  • +

Replies To: ComboBox to ListBox Task

#2 tlhIn`toq  Icon User is offline

  • Please show what you have already tried when asking a question.
  • member icon

Reputation: 5537
  • View blog
  • Posts: 11,868
  • Joined: 02-June 10

Re: ComboBox to ListBox Task

Posted 20 June 2013 - 06:06 AM

Are you really doing this in {out of date} VB6? Should this be moved to VB.net?
Was This Post Helpful? 0
  • +
  • -

#3 d4rknitez  Icon User is offline

  • New D.I.C Head

Reputation: 0
  • View blog
  • Posts: 3
  • Joined: 19-June 13

Re: ComboBox to ListBox Task

Posted 20 June 2013 - 06:26 AM

View PosttlhIn`toq, on 20 June 2013 - 06:06 AM, said:

Are you really doing this in {out of date} VB6? Should this be moved to VB.net?


Yeah, it is out of date. But I've decided to start on VB6 first before moving on to VB.NET. It helps me understand programming better in both sides of the Visual Basics.
Was This Post Helpful? 0
  • +
  • -

#4 maj3091  Icon User is offline

  • D.I.C Lover
  • member icon

Reputation: 300
  • View blog
  • Posts: 1,780
  • Joined: 26-March 09

Re: ComboBox to ListBox Task

Posted 20 June 2013 - 06:49 AM

To be fair, if you're starting out, it would be worth just putting your effort into VB.Net.
Was This Post Helpful? 1
  • +
  • -

#5 d4rknitez  Icon User is offline

  • New D.I.C Head

Reputation: 0
  • View blog
  • Posts: 3
  • Joined: 19-June 13

Re: ComboBox to ListBox Task

Posted 20 June 2013 - 06:55 AM

Well, I'm not familiar with VB.Net yet and I had started out using VB6 the very start of the mid month, this year. Might take me awhile to get familiar with vb.net so, in the mean time I use vb6. And, by the way, thanks guys for your advice. I've found another way to over come this problem. I tried moving the listCars.AddItem "" under the combobox in click event by Clearing the list and adding the items.
Was This Post Helpful? 0
  • +
  • -

Page 1 of 1