Beispiel #1
0
        private void btnOK_Click(object sender, EventArgs e)
        {
            TextCheck tc = new TextCheck();

            if (!tc.checkInputPort(this.txtPort.Text))
            {
                MessageBox.Show(tc.WarningMessage);
                this.txtPort.Clear();
                this.txtPort.Focus();
                return;
            }



            if (!MyPort.checkPort(this.txtPort.Text))
            {
                MessageBox.Show("端口" + this.txtPort.Text + "已被占用,请重选选择,或者使用选择端口");
                this.txtPort.Clear();
                this.txtPort.Focus();
            }
            else
            {
                chatClientForm fm = (chatClientForm)this.Owner;
                GroupBox       gb = (GroupBox)((TabPage)((TabControl)fm.Controls["myTabControl"]).Controls["registrationTab"]).Controls["groupBox1"];
                ((TextBox)(gb.Controls["txtHostPort"])).Text = this.txtPort.Text;
                this.Close();
            }
        }
Beispiel #2
0
 private void btnReset_Click(object sender, EventArgs e)
 {
     this.cmbPort.DataSource = MyPort.getPorts(15);
 }
Beispiel #3
0
 public hostPortForm()
 {
     InitializeComponent();
     this.cmbPort.DataSource = MyPort.getPorts(15);
 }