Still celebrating National IT Professionals Day with 3 months of free Premium Membership. Use Code ITDAY17


How to populate combobox dropdown from existing collection without looping

Posted on 2000-04-30
Medium Priority
Last Modified: 2010-05-02
How to populate combobox dropdown list from existing collection without looping and display multiple columns in selection list. Maybe by using a grid as the drop down list.
Question by:dbishop
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 2
  • 2
  • 2
  • +1

Expert Comment

ID: 2764265
How would you ? You have to loop though a collection to populate it , i don't think there is another way.
LVL 28

Expert Comment

ID: 2764272
you cant, you have to recurse through and add the items.  if you had the information in a database you can use the datacombo control though.

Author Comment

ID: 2764275
Edited text of question.
Concerto Cloud for Software Providers & ISVs

Can Concerto Cloud Services help you focus on evolving your application offerings, while delivering the best cloud experience to your customers? From DevOps to revenue models and customer support, the answer is yes!

Learn how Concerto can help you.

LVL 28

Accepted Solution

AzraSound earned 2000 total points
ID: 2764280
i think what you want to use is the listview control.  its like a listbox but it supports multi columns.  if this interests you let me know and i can post some code on how to use it.

Expert Comment

ID: 2764284
It ain't that hard to create your own combobox, all you need is a simple textbox, a picturebox and the grid. You use the Line method to draw a pressed or unpressed button interface on the picturebox (you can not use a normal commandbutton because it will look terrible when it has the focus), in the MouseDown event draw a pressed button and in the MouseUp event draw a unpressed button. In the MouseUp event you also want to toggle the visibility of your grid. Voila! You have a combobox that has a grid as the dropdown control.

Expert Comment

ID: 2764286
Here's the code I use to draw the button interface on the picturebox.

Public Sub DrawDown()

  'This will draw a pressed button interface
  'in the picButton picturebox, emulating a
  'real commandbutton
  picButton.Line (0, 0)-(15, 16), vb3DShadow, B
  picButton.Line (5, 7)-Step(7, 0), vbBlack
  picButton.Line (6, 8)-Step(5, 0), vbBlack
  picButton.Line (7, 9)-Step(3, 0), vbBlack
  picButton.Line (8, 10)-Step(1, 0), vbBlack

End Sub

Public Sub DrawUp()

  'This will draw a unpressed button interface
  'in the picButton picturebox, emulating a
  'real commandbutton
  picButton.Line (0, 0)-(0, 17), vbWhite
  picButton.Line (0, 0)-(15, 0), vb3DLight
  picButton.Line (0, 0)-(0, 16), vb3DLight
  picButton.Line (1, 15)-(15, 15), vb3DShadow
  picButton.Line (14, 1)-(14, 15), vb3DShadow
  picButton.Line (0, 16)-(15, 16), vbBlack
  picButton.Line (1, 1)-(14, 1), vbWhite
  picButton.Line (1, 1)-(1, 15), vbWhite
  picButton.Line (15, 0)-(15, 17), vbBlack
  picButton.Line (4, 6)-Step(7, 0), vbBlack
  picButton.Line (5, 7)-Step(5, 0), vbBlack
  picButton.Line (6, 8)-Step(3, 0), vbBlack
  picButton.Line (7, 9)-Step(1, 0), vbBlack

End Sub

Author Comment

ID: 2764295
Yes, please send me an example.

I have to make a selection from a drop down list. Each row will have three columns.

my email is:


Featured Post

On Demand Webinar: Networking for the Cloud Era

Ready to improve network connectivity? Watch this webinar to learn how SD-WANs and a one-click instant connect tool can boost provisions, deployment, and management of your cloud connection.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

I was working on a PowerPoint add-in the other day and a client asked me "can you implement a feature which processes a chart when it's pasted into a slide from another deck?". It got me wondering how to hook into built-in ribbon events in Office.
You can of course define an array to hold data that is of a particular type like an array of Strings to hold customer names or an array of Doubles to hold customer sales, but what do you do if you want to coordinate that data? This article describes…
As developers, we are not limited to the functions provided by the VBA language. In addition, we can call the functions that are part of the Windows operating system. These functions are part of the Windows API (Application Programming Interface). U…
Show developers how to use a criteria form to limit the data that appears on an Access report. It is a common requirement that users can specify the criteria for a report at runtime. The easiest way to accomplish this is using a criteria form that a…
Suggested Courses

715 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question