Still celebrating National IT Professionals Day with 3 months of free Premium Membership. Use Code ITDAY17

x
?
Solved

select list box

Posted on 1998-08-30
3
Medium Priority
?
136 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
[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
  • 3
3 Comments
 
LVL 3

Accepted Solution

by:
a111a111a111 earned 200 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

VIDEO: THE CONCERTO CLOUD FOR HEALTHCARE

Modern healthcare requires a modern cloud. View this brief video to understand how the Concerto Cloud for Healthcare can help your organization.

Question has a verified solution.

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

Introduction In a recent article (http://www.experts-exchange.com/A_7811-A-Better-Concatenate-Function.html) for the Excel community, I showed an improved version of the Excel Concatenate() function.  While writing that article I realized that no o…
If you need to start windows update installation remotely or as a scheduled task you will find this very helpful.
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…
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…
Suggested Courses

664 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