?
Solved

Multiselect listbox options in VB6 and VBA

Posted on 2007-03-19
2
Medium Priority
?
1,003 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
[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 Comments
 
LVL 4

Accepted Solution

by:
psychakias2 earned 2000 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

Enroll in August's Course of the Month

August's CompTIA IT Fundamentals course includes 19 hours of basic computer principle modules and prepares you for the certification exam. It's free for Premium Members, Team Accounts, and Qualified 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 shows the viewer how to set up and create Footnotes in their document. Click on the References tab: Select "Insert Footnote": Type in desired text:
Learn how to make your own table of contents in Microsoft Word using paragraph styles and the automatic table of contents tool. We'll be using the paragraph styles in Word’s Home toolbar to help you create a table of contents. Type out your initial …
Suggested Courses

764 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