checkedlistBox and listBox

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • Hrvoje Voda

    #1

    checkedlistBox and listBox

    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


  • Yunus Emre ALPÖZEN [MCAD.NET]

    #2
    Re: checkedlistBox and listBox

    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...


    --

    Thanks,
    Yunus Emre ALPÖZEN
    BSc, MCAD.NET

    "Hrvoje Voda" <hrvoje.voda@lu atech.com> wrote in message
    news:d5flnj$als $1@ss405.t-com.hr...[color=blue]
    >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
    >[/color]


    Comment

    Working...