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

x
?
Solved

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

Posted on 2008-06-13
1
Medium Priority
?
287 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 2000 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

On Demand Webinar: Networking for the Cloud Era

Did you know SD-WANs can improve network connectivity? Check out this webinar to learn how an SD-WAN simplified, one-click tool can help you migrate and manage data in the cloud.

Question has a verified solution.

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

A while ago, I was working on a Windows Forms application and I needed a special label control with reflection (glass) effect to show some titles in a stylish way. I've always enjoyed working with graphics, but it's never too clever to re-invent …
Calculating holidays and working days is a function that is often needed yet it is not one found within the Framework. This article presents one approach to building a working-day calculator for use in .NET.
This is my first video review of Microsoft Bookings, I will be doing a part two with a bit more information, but wanted to get this out to you folks.
In response to a need for security and privacy, and to continue fostering an environment members can turn to for support, solutions, and education, Experts Exchange has created anonymous question capabilities. This new feature is available to our Pr…
Suggested Courses

688 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