Link to home
Start Free TrialLog in
Avatar of aplelois
aplelois

asked on

listbot

hello,
I have a listbot that has 5 names coming from an ini file
and a label called names.
when you open the program you see Name: Person1
but when I select Person3 in the listbox it doesnt show
in the label, how can I do this?
ASKER CERTIFIED SOLUTION
Avatar of AlexFM
AlexFM

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of aplelois
aplelois

ASKER

thanks a lot!
well, I got a problem cause I have

first name
last name
email

ini file is
fist;last;email@dom.com;

so when I add in LabelName it only shows up the name
Does listbox contain all fields?
I think you need ListView for this. It can contain three columns for first name, last name and email. Handle SelectedIndexChanged event and fill label with three fields or make three labels for every field.
now it only shows the name
ok listview sound great!
I would like to show something like this

First Name: person1
Last Name: person2
Email: email

so when the ppl select the name from the listbox
it changes the infotmation to the person
how would I do that? something simple!
Suppose you have ListView with three columns and three lables.

Private Sub ListView1_SelectedIndexChanged(ByVal sender As Object, ByVal e As System.EventArgs) _
        Handles ListView1.SelectedIndexChanged

         Dim items As ListView.SelectedListViewItemCollection = _
            Me.ListView1.SelectedItems

         if ( items.Count > 0 ) then
             LabelName.Text = items(0).SubItems(0).Text
             LabelLastName.Text = items(0).SubItems(1).Text
             LabelMail.Text = items(0).SubItems(2).Text
         end if
End Sub
how do I add a label to the listview I cant find the way