Quantcast
Channel: VBForums - Visual Basic 6 and Earlier
Viewing all articles
Browse latest Browse all 21839

ListBox Help

$
0
0
Hey guys,
Being the amateur that I am, I do not know how I can select a record in a listbox and then display the contents somewhere else.
Basically, I load a txt file for Input (which consists of user's and passwords), of which only 1 part is displayed in a list box-eg username. When this is selected and a cmd button is pressed, I want this to display all the information of the specific 'user' selected somewhere else. I know there is a selected property but technically none of the information shown in the list box is in an array... i think.
Thanks in advance



Code:

Dim user As Integer
user = lstusers.Selected ???
If user Then

If MsgBox("Please select a user", vbExclamation + vbOKOnly, "Select a user") = vbOK Then

End If
Else
If MsgBox("Are you sure you want to delete this user?", vbYesNo + vbExclamation, "Delete?") = vbYes Then
lstusers.RemoveItem (user)
End If
End If
End Sub


Viewing all articles
Browse latest Browse all 21839

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>