Quantcast
Channel: VBForums - Visual Basic 6 and Earlier
Viewing all articles
Browse latest Browse all 21278

Combobox showing options in listbox??

$
0
0
Hello All!

I'm totally new on this. But I'm trying :)

I was thinking of creating a Character generator to an Old time RPG (Paper and pen) and was thinking of using a ComboBox to select the Race and then the ListBox will list some avaliable options regarding the race.

In my example...
The ComboBox lists 3 races. Human, Dwarf and Elf.
If you select Human then the ListBox will show "Empire" and "Stormcloaks"
If you select Dwarf then the ListBox will show "Mountain" and "Fire"
If you select Elf then the ListBox will show "Forest" and "Dark"

Anyone having an idea on how to do it??

This is my code and it's VB6

Private Sub Combo1_Change()
If Combo1.Text = "Human" Then
List1.AddItem = "Empire"
List1.AddItem = "Stormcloak"

End If

End Sub

Private Sub Form_Load()
Combo1.AddItem "Human"
Combo1.AddItem "Dwarf"
Combo1.AddItem "Elf"


End Sub

Private Sub List1_Click()

End Sub

Viewing all articles
Browse latest Browse all 21278

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>