Beispiel #1
0
        private void button2_Click(object sender, EventArgs e)
        {
            string ID_Selected = listView1.SelectedItems[0].SubItems[0].Text;

            //判断是否已经是自己的好友
            bool isfriend = false;

            for (int i = 0; i < Friends.FriendsNum; i++)
            {
                if (Friends.FriendInfo[i].id == ID_Selected)
                {
                    isfriend = true;
                }
            }
            if (isfriend == true)
            {
                MessageBox.Show("这已经是您的好友了");
                return;
            }
            SendRequest sr = new SendRequest(ID_Selected);

            sr.ShowDialog();
            if (sr.DialogResult == DialogResult.OK)
            {
                this.Close();
            }
        }
Beispiel #2
0
 private void button2_Click(object sender, EventArgs e)
 {
     string ID_Selected = listView1.SelectedItems[0].SubItems[0].Text;
     
     //判断是否已经是自己的好友
     bool isfriend =false;
     for(int i=0;i<Friends.FriendsNum;i++)
     {
         if (Friends.FriendInfo[i].id == ID_Selected)
             isfriend = true;
     }
     if(isfriend==true)
     {
         MessageBox.Show("这已经是您的好友了");
         return;
     }
     SendRequest sr = new SendRequest(ID_Selected);
     sr.ShowDialog();
     if(sr.DialogResult==DialogResult.OK)
     {
         this.Close();
     }
 }