Solved

How to populate combobox dropdown from existing collection without looping

Posted on 2000-04-30
7
328 Views
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.
0
Comment
Question by:dbishop
[X]
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
7 Comments
 
LVL 6

Expert Comment

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

Expert Comment

by:AzraSound
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.
0
 

Author Comment

by:dbishop
ID: 2764275
Edited text of question.
0
Technology Partners: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

 
LVL 28

Accepted Solution

by:
AzraSound earned 500 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.
0
 
LVL 7

Expert Comment

by:Vbmaster
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.
0
 
LVL 7

Expert Comment

by:Vbmaster
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.Cls
  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.Cls
  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
0
 

Author Comment

by:dbishop
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:
hdbishopjr@hotmail.com

Thanks,
Dave
0

Featured Post

Creating Instructional Tutorials  

For Any Use & On Any Platform

Contextual Guidance at the moment of need helps your employees/users adopt software o& achieve even the most complex tasks instantly. Boost knowledge retention, software adoption & employee engagement with easy solution.

Question has a verified solution.

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

Introduction While answering a recent question about filtering a custom class collection, I realized that this could be accomplished with very little code by using the ScriptControl (SC) library.  This article will introduce you to the SC library a…
If you need to start windows update installation remotely or as a scheduled task you will find this very helpful.
Get people started with the process of using Access VBA to control Outlook using automation, Microsoft Access can control other applications. An example is the ability to programmatically talk to Microsoft Outlook. Using automation, an Access applic…
Get people started with the process of using Access VBA to control Excel using automation, Microsoft Access can control other applications. An example is the ability to programmatically talk to Excel. Using automation, an Access application can laun…
Suggested Courses
Course of the Month8 days, left to enroll

617 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