Question:

Visual Basic (SelectedIndex) Question?

by  |  earlier

0 LIKES UnLike

Hi, I wanna know if this is possible in VB 2005.

If I select an item in Listbox1, let's say the item is in "Index 3" (Listbox1); the "Index 3" in Listbox2 will also highlight.

If it is possible, please share me the code.

Or Is there any other way to do this? All I wanna do is when I remove an Item in a Listbox, an item of the same index on another Listbox will also be removed.

Thank You

alydhiends

 Tags:

   Report

1 ANSWERS


  1. Sure, it is possible! With good coding skills, all things are possible : )

    Basically, you will need to get the index of the item selected in the first listbox, by doing something like

    Dim theSelection as Integer

    theSelection = myListBox.SelectedIndex

    ...then use the "RemoveAt" method of the "Items" collection for the other listbox.

    Here is a website with some very helpful examples :

    http://www.startvbdotnet.com/controls/li...

    Good luck : )

Question Stats

Latest activity: earlier.
This question has 1 answers.

BECOME A GUIDE

Share your knowledge and help people by answering questions.