예제 #1
0
파일: Form1.cs 프로젝트: augaria/GomokuGUI
 public void endChat(string name)
 {
     if (tabControl1.InvokeRequired)
     {
         OneStringInvoke _endChatInvoke = new OneStringInvoke(endChat);
         this.Invoke(_endChatInvoke, new object[] { name });
     }
     else
     {
         for (int i = 1; i < tabControl1.TabPages.Count; i++)
         {
             if (tabControl1.TabPages[i].Name.Equals(name))
             {
                 tabControl1.TabPages.RemoveAt(i);
                 return;
             }
         }
     }
 }
예제 #2
0
파일: Form1.cs 프로젝트: augaria/GomokuGUI
 public void addChat(string name)
 {
     if (tabControl1.InvokeRequired)
     {
         OneStringInvoke _addChatInvoke = new OneStringInvoke(addChat);
         this.Invoke(_addChatInvoke, new object[] { name });
     }
     else
     {
         TabPage tp = new TabPage();
         tp.Name = name;
         tp.Text = name;
         RichTextBox rtb = new RichTextBox();
         rtb.Size         = new System.Drawing.Size(244, 179);
         rtb.Location     = new System.Drawing.Point(0, 0);
         rtb.TextChanged += richTextBoxTextChanged;
         tp.Controls.Add(rtb);
         tp.Enter += tabFocus;
         tabControl1.TabPages.Add(tp);
         System.Media.SystemSounds.Beep.Play();
     }
 }