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); } }
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); } }
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); } } }
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); }