checkedlistBox and listBox

  • Thread starter Thread starter Hrvoje Voda
  • Start date Start date
H

Hrvoje Voda

I have a users name in checkedlistBox and usersID in listBox.

How to connect those to lists to get a userID from listBox depending on
userName from checkedlistBox?

Hrcko
 
You should implement a class something like this;

class UserInfo
{
public string username;
public int userID;
public UserInfo(string pUsername,int pUserID)
{
username = pUsername;
userID=pUserID;
}
public override string ToString()
{
return username;
}
}

Add every user to checkedlistbox as a userinfo object. This will display
username in checked list box. And you can cast any item to this class and
access its any info...
 
Back
Top