find strings in listbox
#2

i usually use this (vb.net)

Dim searchString As String = TextBox4.Text
Dim index As Integer = UserList.FindString(searchString)
If string.contains = true then, else error.
If index <> -1 Then
UserList.SetSelected(index, True)
Else
MsgBox("Not Found")
End If

may be in c# can be like :

string searchString = TextBox4.Text;
int index = UserList.FindString(searchString);
// If string.contains = true then, else error.
if (index != -1) {
UserList.SetSelected(index, true);
} else {
Interaction.MsgBox("Not Found");
}



Messages In This Thread
[No subject] - by soryjero - 08-01-2013, 01:04 PM
[No subject] - by ReturnKratos - 08-01-2013, 01:19 PM
[No subject] - by soryjero - 08-01-2013, 02:23 PM
[No subject] - by ReturnKratos - 08-01-2013, 03:26 PM
[No subject] - by Wizatek - 08-01-2013, 04:06 PM
[No subject] - by someone - 08-01-2013, 04:46 PM
[No subject] - by soryjero - 08-01-2013, 11:22 PM
[No subject] - by soryjero - 08-02-2013, 08:51 AM

Forum Jump:


Users browsing this thread: 1 Guest(s)