Solved

Multiselect listbox options in VB6 and VBA

Posted on 2007-03-19
2
973 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

Netscaler Common Configuration How To guides

If you use NetScaler you will want to see these guides. The NetScaler How To Guides show administrators how to get NetScaler up and configured by providing instructions for common scenarios and some not so common ones.

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
SQL VB connection works in one PC and doesn't in another 15 64
In MS Word, rename styles in a batch 9 44
VBA MS Word "Table of Contents" extractor` 4 41
Excel Automation VBA 19 70
This article describes how to use the Send to Mail Recipient command. The instructions apply generally to Office 2007 and later versions, but Microsoft® Word 2013 was used for the specific steps and figures.  What is Send to Mail Recipient? Send…
I was working on a PowerPoint add-in the other day and a client asked me "can you implement a feature which processes a chart when it's pasted into a slide from another deck?". It got me wondering how to hook into built-in ribbon events in Office.
This video walks the viewer through the process of creating an MLA formatted document, as well as a bibliography with citations.
This video walks the viewer through the process of creating Hyperlinks for the web and other documents. Select the "Insert" tab: Click "Hyperlink":  Type "http://" followed by a web address to reference a website or navigate to a document to ref…

777 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