Exemplo n.º 1
0
 private void Ip3_KeyPress(object sender, KeyPressEventArgs e)
 {
     if ((Keys)e.KeyChar == Keys.Tab && Ip3.Text.Length > 0 && Ip3.SelectionLength == 0)
     {
         Ip4.Focus();
         Ip4.Select(0, Ip4.Text.Length);
     }
 }
Exemplo n.º 2
0
        private void Ip3_TextChanged(object sender, EventArgs e)
        {
            if (Ip3.Text.Length == 3 && Ip3.Text.Length > 0 && Ip3.SelectionLength == 0)
            {
                Ip4.Focus();
                Ip4.Select(0, Ip4.Text.Length);
            }

            if (Ip3.Text.LastIndexOf('.') != -1)
            {
                Ip3.Text.Replace('.', ' ');
                Ip4.Focus();
                Ip4.Select(0, Ip4.Text.Length);
            }
        }
Exemplo n.º 3
0
 private void Ip3_TextChanged(object sender, EventArgs e)
 {
     if (Ip3.Text.Length == 3 && Ip3.Text.Length > 0 && Ip3.SelectionLength == 0)
     {
         if (Convert.ToInt32(Ip3.Text) > 255)
         {
             Ip3.Text = "255";
         }
         else
         {
             Ip4.Focus();
             Ip4.Select(0, Ip4.Text.Length);
         }
     }
 }
Exemplo n.º 4
0
        private void Ip3_KeyPress(object sender, KeyPressEventArgs e)
        {
            string inputStr = e.KeyChar.ToString();

            if (e.KeyChar != (char)ConsoleKey.Backspace)
            {
                if (e.KeyChar == 46 && Ip3.Text.Length > 0 && Ip3.SelectionLength == 0)
                {
                    Ip4.Focus();
                    Ip4.Select(0, Ip4.Text.Length);
                }
                if (CheckInput(inputStr) == false)
                {
                    e.Handled = true;
                }
            }

            base.OnKeyPress(e);
        }
Exemplo n.º 5
0
 public string GetIpAsString()
 {
     return(Ip1.ToString() + '.' + Ip2.ToString() + '.' + Ip3.ToString() + '.' + Ip4.ToString());
 }