add to combobox from listbox in another form

Reply

Join Date: Jun 2006
Posts: 12
Reputation: shalini_roy is an unknown quantity at this point 
Solved Threads: 0
shalini_roy shalini_roy is offline Offline
Newbie Poster

add to combobox from listbox in another form

 
0
  #1
Jun 29th, 2006
how do i add items to a combobox from a listbox that is in another form??
Reply With Quote Quick reply to this message  
Join Date: Jun 2006
Posts: 119
Reputation: agrothe is an unknown quantity at this point 
Solved Threads: 14
agrothe's Avatar
agrothe agrothe is offline Offline
Junior Poster

Re: add to combobox from listbox in another form

 
0
  #2
Jun 30th, 2006
Originally Posted by shalini_roy
how do i add items to a combobox from a listbox that is in another form??
You can reference the listbox directly using:
Visual Basic 4 / 5 / 6 Syntax (Toggle Plain Text)
  1. combobox.additem frmOtherfrm.listbox1.index(frmOtherfrm.listbox1.listindex)
This code will grab the currently selected item, and will cause an error if there is no selected item. You probably want to cycle through all the items, or search for a particle one based on criterea though.
------------------------------------------------------------
If you see no coffee in my immediate vicinity, speak slowly and use small words....
ConnectNL Directory | Blog
Reply With Quote Quick reply to this message  
Join Date: Dec 2004
Posts: 2,413
Reputation: Comatose is a jewel in the rough Comatose is a jewel in the rough Comatose is a jewel in the rough Comatose is a jewel in the rough 
Solved Threads: 211
Team Colleague
Comatose's Avatar
Comatose Comatose is offline Offline
Taboo Programmer

Re: add to combobox from listbox in another form

 
0
  #3
Jun 30th, 2006
Nice Job. If you are trying to get the item that is selected in the listbox, you could use list, instead of item, but nicely said.
Reply With Quote Quick reply to this message  
Reply

This thread is more than three months old.
Perhaps start a new thread instead?
Message:



Similar Threads
Other Threads in the Visual Basic 4 / 5 / 6 Forum
Thread Tools Search this Thread



About Us | Contact Us | Advertise | DaniWeb | Acceptable Use Policy | RSS Feed

©2003 - 2009 DaniWeb® LLC