private void InnerTextBox_Enter(object sender, EventArgs e) { if (m_text.Length == 0) { InnerTextBox.Select(0, 0); } }
/// <summary> /// Event delegate method fired when the <see cref="SearchEdit"/> control is resized. /// </summary> /// <param name="sender">Sender object.</param> /// <param name="e">Event arguments.</param> private void SearchEdit_Resize(object sender, EventArgs e) { int imageWidth = ScaledImageWidth; int xOffset = imageWidth + (_imageXOffset * 2); InnerTextBox.SetBounds(xOffset, (Height - InnerTextBox.Height) / 2, Size.Width - xOffset, InnerTextBox.Height); }
public void PrepareEditingControlForEdit(bool selectAll) { if (selectAll) { InnerTextBox.SelectAll(); } else { // Do not select all the text, but // position the caret at the end of the text InnerTextBox.SelectionStart = InnerTextBox.Text.Length; } }
private void InnerTextBox_KeyDown(object sender, KeyEventArgs e) { if (m_text.Length == 0) { InnerTextBox.Clear(); InnerTextBox.ForeColor = ForeColor; } if (e.KeyCode == Keys.Enter) { if (EnterPressed != null) { EnterPressed.Invoke(this, new EventArgs()); } } }
/// <summary> /// Sets input focus to a control. /// </summary> public void Focus(bool safe) { InnerTextBox?.Focus(safe); }
public void SelectAll() { InnerTextBox.SelectAll(); }
private void MetroTextBox_Click(object sender, EventArgs e) { InnerTextBox.Select(); }