Solved

Multiselect listbox options in VB6 and VBA

Posted on 2007-03-19
2
958 Views
Last Modified: 2008-02-01
Hi Experts,

In converting a project from VBA to VB6, I've encountered a problem.

In VBA, the options for my listbox are:
Liststyle: 1
Multiselect: 0
This gives a listbox with radio button type controls, ie each line in the list can only be selected once (as opposed to the version with tick boxes where you can select many times)

In VB6 the options for my listbox are:
either
Style 0
Multiselect 0
This has the same features, ie you can only select one item at a time, but there are no radio buttons - so it looks a bit strange.  Alternatively, if you set style to 1, you get checkboxes which doesn't make sense with an individual item select.

Is there any way to get VB6 to do the radio buttons for individual item select the way that VBA does?

Thanks in advance,

PatternNut



0
Comment
Question by:PatternNut
2 Comments
 
LVL 4

Accepted Solution

by:
psychakias2 earned 500 total points
Comment Utility
You do you this by using the exact same control that VBA uses.

Right click on your Toolbox and select COMPONENTS.
From the list that pops up, select MICROSOFT FORMS 2.0 OBJECT LIBRARY.

After you do this, you will be able to see in your toolbox some new controls, along with a new Listbox which when used, it will give you the behavior you want.
0
 

Author Comment

by:PatternNut
Comment Utility
Wow.  That was easy.  Thanks so much, I really appreciate it.

Cheers,

PatternNut
0

Featured Post

Enabling OSINT in Activity Based Intelligence

Activity based intelligence (ABI) requires access to all available sources of data. Recorded Future allows analysts to observe structured data on the open, deep, and dark web.

Join & Write a Comment

The Selection object is designed for user interaction. It has a Range property, so it can be used in most places that a Range object can. Recorded macros must use the Selection because they are simply copying what the user is doing. A Range prope…
Shortcuts in Word Just the other day I had a training for Microsoft and they wanted me to show how well the new Windows and Office behaved on a touch device, which by the way is great, but it was only then that I realized that using keyboard shortc…
Get people started with the utilization of class modules. Class modules can be a powerful tool in Microsoft Access. They allow you to create self-contained objects that encapsulate functionality. They can easily hide the complexity of a process from…
The viewer will learn how to make their project stand out over others by learning how to change colors and shapes, add spaces, change directions, and add bullets to their charts.

771 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

11 Experts available now in Live!

Get 1:1 Help Now