Solved

How to populate combobox dropdown from existing collection without looping

Posted on 2000-04-30
7
312 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
  • 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
IT, Stop Being Called Into Every Meeting

Highfive is so simple that setting up every meeting room takes just minutes and every employee will be able to start or join a call from any room with ease. Never be called into a meeting just to get it started again. This is how video conferencing should work!

 
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

Find Ransomware Secrets With All-Source Analysis

Ransomware has become a major concern for organizations; its prevalence has grown due to past successes achieved by threat actors. While each ransomware variant is different, we’ve seen some common tactics and trends used among the authors of the malware.

Join & Write a Comment

Suggested Solutions

Background What I'm presenting in this article is the result of 2 conditions in my work area: We have a SQL Server production environment but no development or test environment; andWe have an MS Access front end using tables in SQL Server but we a…
If you need to start windows update installation remotely or as a scheduled task you will find this very helpful.
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…
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…

707 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

Need Help in Real-Time?

Connect with top rated Experts

13 Experts available now in Live!

Get 1:1 Help Now