Solved

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

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

Free Tool: Postgres Monitoring System

A PHP and Perl based system to collect and display usage statistics from PostgreSQL databases.

One of a set of tools we are providing to everyone 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

This article explains how to create and use a custom WaterMark textbox class.  The custom WaterMark textbox class allows you to set the WaterMark Background Color and WaterMark text at design time.   IMAGE OF WATERMARKS STEPS Create VB …
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…

735 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