Solved

Listbox

Posted on 1998-08-15
1
149 Views
Last Modified: 2010-04-30
Do you Know How to make it so there are like 2 list boxes and when you click on a Item in list1 it shows only there Msgs in list2
0
Comment
Question by:Scorpion2000
1 Comment
 

Accepted Solution

by:
mwam earned 10 total points
ID: 1429095
there may be better ways to do this but it works:
'---------start code-------------
Private Sub Form_Load()
List1.AddItem "this string"
List1.AddItem "that string"
List1.AddItem "this and that string"

End Sub

Private Sub List1_Click()
List2.Clear

For i = 0 To List1.ListCount - 1
If List1.Selected(i) = True Then List2.AddItem List1.List(i)

Next
End Sub
'------------------end code-----------------
0

Featured Post

Free Tool: Path Explorer

An intuitive utility to help find the CSS path to UI elements on a webpage. These paths are used frequently in a variety of front-end development and QA automation tasks.

One of a set of tools we're offering as a way of saying thank you for being a part of the community.

Question has a verified solution.

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

Article by: Martin
Here are a few simple, working, games that you can use as-is or as the basis for your own games. Tic-Tac-Toe This is one of the simplest of all games.   The game allows for a choice of who goes first and keeps track of the number of wins for…
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.
As developers, we are not limited to the functions provided by the VBA language. In addition, we can call the functions that are part of the Windows operating system. These functions are part of the Windows API (Application Programming Interface). U…
Get people started with the process of using Access VBA to control Excel using automation, Microsoft Access can control other applications. An example is the ability to programmatically talk to Excel. Using automation, an Access application can laun…

821 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