|
-
Aug 6th, 2005, 08:14 PM
#1
Thread Starter
Member
combobox to Listbox
I`ve got a combobox with 10 item and a list box to view 2 item and for each selected item in combobox, I want the listbox view 2 item specified by code.
for example
if combobox1.text = "item1" then
listbox1.items.add("aaa" & "bbb")
something like this but I could`t do this, thanks for your help.
Oz
-
Aug 7th, 2005, 02:54 AM
#2
Re: combobox to Listbox
 Originally Posted by talentedbro
I`ve got a combobox with 10 item and a list box to view 2 item and for each selected item in combobox, I want the listbox view 2 item specified by code.
for example
if combobox1.text = "item1" then
listbox1.items.add("aaa" & "bbb")
something like this but I could`t do this, thanks for your help.
Oz
why does this not work? could you be more specific, because it should be as simple as this:
VB Code:
if combobox1.text = "item1" then
listbox1.items.clear()
listbox1.items.add("aaa")
listbox1.items.add("bbb")
end if
However, you could make this more dynamic using arraylists.
-
Aug 7th, 2005, 12:15 PM
#3
Thread Starter
Member
Re: combobox to Listbox
If I write this code inside of a button click, it works properly but I want that by choosing the items in the combobox, listbox shows the result directly and I don`t know why its not working.
-
Aug 7th, 2005, 01:25 PM
#4
Fanatic Member
Re: combobox to Listbox
Hi..
Maybe you could try using something like..
Godwin
Help someone else with what someone helped you! 
-
Aug 7th, 2005, 06:34 PM
#5
Lively Member
Re: combobox to Listbox
You could always use the combobox's follow events
SelectedValueChanged
Validating
LostFocus
Considering that you want it to change the listbox's items. I would be more inclined to use the SelectedValueChanged event.
Hope this helps
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|