Solved

How to process a selection in a listbox, and set a selection in code

Posted on 2008-06-13
1
247 Views
Last Modified: 2010-04-23
I have listbox on a form in my VB 6.0 app.  I simply  need to be able to do two things:

 1) In my app, I keep track of what item is currently selected.  So, when the form is displayed, I need to highlight that item in the listbox.

2) Upon a list item selection, I need to immediately process the selection and update my dialog.

Thanks ahead of time.
0
Comment
Question by:clintonJ
1 Comment
 
LVL 11

Accepted Solution

by:
AkisC earned 500 total points
ID: 21784282
create a sub or function that will do the work you want and

dim item as integer=me.listbox.FindString ("xxxxx")
if item>-1 then
   listbox.SetSelected(item, True)
   //call the sub to do your work
end if

0

Featured Post

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

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

Well, all of us have seen the multiple EXCEL.EXE's in task manager that won't die even if you call the .close, .dispose methods. Try this method to kill any excels in memory. You can copy the kill function to create a check function and replace the …
Article by: Kraeven
Introduction Remote Share is a simple remote sharing tool, enabling you to see, add and remove remote or local shares. The application is written in VB.NET targeting the .NET framework 2.0. The source code and the compiled programs have been in…
Here's a very brief overview of the methods PRTG Network Monitor (https://www.paessler.com/prtg) offers for monitoring bandwidth, to help you decide which methods you´d like to investigate in more detail.  The methods are covered in more detail in o…
The Email Laundry PDF encryption service allows companies to send confidential encrypted  emails to anybody. The PDF document can also contain attachments that are embedded in the encrypted PDF. The password is randomly generated by The Email Laundr…

943 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

Need Help in Real-Time?

Connect with top rated Experts

17 Experts available now in Live!

Get 1:1 Help Now