private void KtxtHexValue_TextChanged(object sender, EventArgs e) { if (!TranslationMethods.IsHexadecimal(ktxtHexValue.Text) && !string.IsNullOrWhiteSpace(ktxtHexValue.Text)) { ktxtHexValue.Clear(); ExtendedKryptonMessageBox.Show("A invalid character has been entered, please try again.", "Invalid Content", MessageBoxButtons.OK, MessageBoxIcon.Warning); } if (ktxtHexValue.Text.Length == 3 || ktxtHexValue.Text.Length == 6) { UpdateColour(ktxtHexValue.Text); } }
/// <summary> /// Clears all text from the text box control. /// </summary> public void Clear() { _textBox.Clear(); }