예제 #1
0
 private void ConnectButton_Click(object sender, EventArgs e)
 {
     if (RegexTests.checkIP(Adress.Text) && RegexTests.isPortNumber(PortBox.Text))
     {
         DialogResult = DialogResult.OK;
         this.Close();
     }
     else
     {
         MessageBox.Show("Niepoprawny adres IP lub/i numer portu", "Błąd", MessageBoxButtons.OK, MessageBoxIcon.Error);
     }
 }
예제 #2
0
 private void PortBox_SelectedIndexChanged(object sender, EventArgs e)
 {
     PortBox.BackColor = (!RegexTests.isNumber(PortBox.Text)) ? Color.Red : Color.White;
 }
예제 #3
0
 private void Adress_TextChanged(object sender, EventArgs e)
 {
     Adress.BackColor = (RegexTests.checkIP(Adress.Text)) ? Color.LightGreen : Color.Red;
 }