Solved

Multiselect listbox options in VB6 and VBA

Posted on 2007-03-19
2
976 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
ID: 18753427
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
ID: 18760887
Wow.  That was easy.  Thanks so much, I really appreciate it.

Cheers,

PatternNut
0

Featured Post

Announcing the Most Valuable Experts of 2016

MVEs are more concerned with the satisfaction of those they help than with the considerable points they can earn. They are the types of people you feel privileged to call colleagues. Join us in honoring this amazing group of Experts.

Question has a verified solution.

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

I would like to show you some basics you can do with Mailings in MS Word. It´s quite handy feature you can use for creating envelopes, labels, personalized letters etc. First question could be what is this feature good for? Mailing can really he…
This article describes some techniques which will make your VBA or Visual Basic Classic code easier to understand and maintain, whether by you, your replacement, or another Experts-Exchange expert.
This video walks the viewer through the process of creating an MLA formatted document, as well as a bibliography with citations.
This Micro Tutorial well show you how to find and replace special characters in Microsoft Word. This is similar to carriage returns to convert columns of values from Microsoft Excel into comma separated lists.

839 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