Ejemplo n.º 1
0
 private void Ip2_KeyPress(object sender, KeyPressEventArgs e)
 {
     if ((Keys)e.KeyChar == Keys.Tab && Ip2.Text.Length > 0 && Ip2.SelectionLength == 0)
     {
         Ip3.Focus();
         Ip3.Select(0, Ip3.Text.Length);
     }
 }
Ejemplo n.º 2
0
 private void Ip2_TextChanged(object sender, EventArgs e)
 {
     if (Ip2.Text.Length == 3 && Ip2.Text.Length > 0 && Ip2.SelectionLength == 0)
     {
         if (Convert.ToInt32(Ip2.Text) > 255)
         {
             Ip2.Text = "255";
         }
         else
         {
             Ip3.Focus();
             Ip3.Select(0, Ip3.Text.Length);
         }
     }
 }
Ejemplo n.º 3
0
        private void Ip2_TextChanged(object sender, EventArgs e)
        {
            if (Ip2.Text.Length == 3 && Ip2.Text.Length > 0 && Ip2.SelectionLength == 0)
            {
                Ip3.Focus();
                Ip3.Select(0, Ip3.Text.Length);
            }

            if (Ip2.Text.LastIndexOf('.') != -1)
            {
                Ip2.Text.Replace('.', ' ').Trim();
                Ip3.Focus();
                Ip3.Select(0, Ip3.Text.Length);
            }
        }
Ejemplo n.º 4
0
        private void Ip2_KeyPress(object sender, KeyPressEventArgs e)
        {
            string inputStr = e.KeyChar.ToString();

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

            base.OnKeyPress(e);
        }