User Name Password Register
DaniWeb IT Discussion Community
All
What is DaniWeb IT Discussion Community?
You're currently browsing the Visual Basic 4 / 5 / 6 section within the Software Development category of DaniWeb, a massive community of 401,451 software developers, web developers, Internet marketers, and tech gurus who are all enthusiastic about making contacts, networking, and learning from each other. In fact, there are 2,917 IT professionals currently interacting right now! Registration is free, only takes a minute and lets you enjoy all of the interactive features of the site.
Views: 2634 | Replies: 2
Reply
Join Date: Jun 2006
Posts: 12
Reputation: shalini_roy is an unknown quantity at this point 
Rep Power: 3
Solved Threads: 0
shalini_roy shalini_roy is offline Offline
Newbie Poster

Help add to combobox from listbox in another form

  #1  
Jun 29th, 2006
how do i add items to a combobox from a listbox that is in another form??
AddThis Social Bookmark Button
Reply With Quote  
Join Date: Jun 2006
Posts: 67
Reputation: agrothe is an unknown quantity at this point 
Rep Power: 3
Solved Threads: 9
agrothe's Avatar
agrothe agrothe is offline Offline
Junior Poster in Training

Re: add to combobox from listbox in another form

  #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:
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.
------------------------------------------------------------
ConnectNL Directory | NLTourist | Free eLearing Courses
Reply With Quote  
Join Date: Dec 2004
Location: Lincoln Park, Michigan
Posts: 1,744
Reputation: Comatose is an unknown quantity at this point 
Rep Power: 7
Solved Threads: 107
Colleague
Comatose's Avatar
Comatose Comatose is offline Offline
Moderator

Re: add to combobox from listbox in another form

  #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  
Reply

Only community members can participate in forum threads. You must register or log in to contribute.

DaniWeb Visual Basic 4 / 5 / 6 Marketplace
Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)

 

Thread Tools Display Modes

Similar Threads
Other Threads in the Visual Basic 4 / 5 / 6 Forum

All times are GMT -4. The time now is 1:13 am.
Forum system based on vBulletin Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
©2003 - 2008 DaniWeb® LLC