aplelois
asked on
Listbox
hello,
I have a listbox that has 5 names coming from an ini file
and a 4 labels.
when you open the program you see the labels like this
first ame: name
last name: last
email: email
phone: 123456
and the listbox like this
person1
person2
person3
person4
person5
but when I select Person3 in the listbox it doesnt show the info
in the label, how can I do this?
I have a listbox that has 5 names coming from an ini file
and a 4 labels.
when you open the program you see the labels like this
first ame: name
last name: last
email: email
phone: 123456
and the listbox like this
person1
person2
person3
person4
person5
but when I select Person3 in the listbox it doesnt show the info
in the label, how can I do this?
ASKER
how can I know that?
Hi aplelois;
OK, if you do not know that then I am assuming that you are not setting them.
Can you post the code for the ListBox events such as SelectedIndexChanged or any other code that is pertinent to what you want to do.
Fernando
OK, if you do not know that then I am assuming that you are not setting them.
Can you post the code for the ListBox events such as SelectedIndexChanged or any other code that is pertinent to what you want to do.
Fernando
ASKER
Dim ts As Object
Dim i As Integer
Dim sContent As String
Dim vRows, vCells As Object
fso = CreateObject("Scripting.Fi leSystemOb ject")
ts = fso.OpenTextFile("Accounts .ini")
sContent = ts.ReadAll
ts.Close()
vRows = Split(sContent, vbCrLf)
For i = 0 To UBound(vRows)
vCells = Split(vRows(i), ";")
If UBound(vCells) >= 4 Then lstAccounts.Items.Add((vCe lls(4)))
Next
If lstAccounts.Items.Count > 0 Then lstAccounts.SelectedIndex = 0
Dim i As Integer
Dim sContent As String
Dim vRows, vCells As Object
fso = CreateObject("Scripting.Fi
ts = fso.OpenTextFile("Accounts
sContent = ts.ReadAll
ts.Close()
vRows = Split(sContent, vbCrLf)
For i = 0 To UBound(vRows)
vCells = Split(vRows(i), ";")
If UBound(vCells) >= 4 Then lstAccounts.Items.Add((vCe
Next
If lstAccounts.Items.Count > 0 Then lstAccounts.SelectedIndex = 0
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
aplelois & Fernando
This question and
https://www.experts-exchange.com/questions/21831990/edit-button.html
look to be linked. So what is eventually done in the other may impact on this. Something to bear in mind.
Roger
This question and
https://www.experts-exchange.com/questions/21831990/edit-button.html
look to be linked. So what is eventually done in the other may impact on this. Something to bear in mind.
Roger
Thanks Roger. :=)
ASKER
Error 1 Type 'StreamReader' is not defined.
Add this to the top of the code file:
Imports System.IO
Fernando
Imports System.IO
Fernando
ASKER
error
Post code file
How is the ListBox set up, DataSource, DisplayMember, Value member?
Where is the info for the person1, ..2, - ..5 being kept?
Fernando