Beispiel #1
0
 //查看用户信息
 private void frdstateToolStripMenuItem_Click(object sender, EventArgs e)
 {
     if (this.lv_friends.SelectedItems.Count > 0)
     {
         ListViewItem lvitem = this.lv_friends.SelectedItems[0];
         string       UID1   = lvitem.Text;
         Userstate    us     = isHaveuserstate(UID1);
         if (us != null)
         {
             us.Focus();
         }
         else
         {
             Userstate ust = new Userstate();
             ust.UID = UID1;
             if (UID1 == UID)
             {
                 ust.isself = true;
             }
             else
             {
                 ust.isself = false;
             }
             ust.Bw       = Bw;
             ust.username = lvitem.SubItems[1].Text;
             ust.sign     = lvitem.Tag.ToString();
             userstateList.Add(ust);
             ust.Show();
         }
     }
 }
Beispiel #2
0
        private void button1_Click(object sender, EventArgs e)
        {
            Userstate us = isHaveuserstate(UID);

            if (us != null)
            {
                us.Focus();
            }
            else
            {
                Userstate ust = new Userstate();
                ust.UID      = UID;
                ust.isself   = true;
                ust.Bw       = Bw;
                ust.username = Username;
                ust.sign     = sign;
                userstateList.Add(ust);
                ust.Show();
            }
        }