Solved

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

Posted on 2008-06-13
1
232 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

IT, Stop Being Called Into Every Meeting

Highfive is so simple that setting up every meeting room takes just minutes and every employee will be able to start or join a call from any room with ease. Never be called into a meeting just to get it started again. This is how video conferencing should work!

Join & Write a Comment

Since .Net 2.0, Visual Basic has made it easy to create a splash screen and set it via the "Splash Screen" drop down in the Project Properties.  A splash screen set in this manner is automatically created, displayed and closed by the framework itsel…
It’s quite interesting for me as I worked with Excel using vb.net for some time. Here are some topics which I know want to share with others whom this might help. First of all if you are working with Excel then you need to Download the Following …
Excel styles will make formatting consistent and let you apply and change formatting faster. In this tutorial, you'll learn how to use Excel's built-in styles, how to modify styles, and how to create your own. You'll also learn how to use your custo…
This tutorial demonstrates a quick way of adding group price to multiple Magento products.

744 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

9 Experts available now in Live!

Get 1:1 Help Now