Solved

select list box

Posted on 1998-08-30
3
125 Views
Last Modified: 2010-04-30
i would like to know how to make a button that when pressed it would select all the contents of a list box and press another button to deselect all the contents of the same list box
0
Comment
Question by:440
  • 3
3 Comments
 
LVL 3

Accepted Solution

by:
a111a111a111 earned 50 total points
ID: 1431974
Option Explicit

Private Sub Command1_Click()
Dim A%
For A = 0 To 3
 List1.Selected(A) = True
 Next A
End Sub

Private Sub Command2_Click()
Dim A%
For A = 0 To 3
 List1.Selected(A) = False
 Next A

End Sub

Private Sub Form_Load()
Dim Entry
        List1.Clear
        Entry = "Hello"
        List1.AddItem Entry ' Add the entry.
        Entry = "Bill"
        List1.AddItem Entry
        Entry = "This Is"
        List1.AddItem Entry
        Entry = "a Test"
        List1.AddItem Entry

End Sub

0
 
LVL 3

Expert Comment

by:a111a111a111
ID: 1431975
Hi,
if you need more assistent let me know.

Thank you.

0
 
LVL 3

Expert Comment

by:a111a111a111
ID: 1431976
The key is:

List1.Selected(A) = True

and

List1.Selected(A) = False

Shay.
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
How to debug this code 7 62
Best way to parse out a json string in VB6? 10 176
SLMGR Switches Are Not Working On KMS Host 3 97
Protecting vb6 & .Net code Obfuscation 18 126
Introduction While answering a recent question (http://www.experts-exchange.com/Q_27402310.html) in the VB classic zone, I wrote some VB code in the (Office) VBA environment, rather than fire up my older PC.  I didn't post completely correct code o…
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.
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…
Show developers how to use a criteria form to limit the data that appears on an Access report. It is a common requirement that users can specify the criteria for a report at runtime. The easiest way to accomplish this is using a criteria form that a…

831 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