Exemplo n.º 1
0
 private void InnerTextBox_Enter(object sender, EventArgs e)
 {
     if (m_text.Length == 0)
     {
         InnerTextBox.Select(0, 0);
     }
 }
Exemplo n.º 2
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);
        }
Exemplo n.º 3
0
 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;
     }
 }
Exemplo n.º 4
0
        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());
                }
            }
        }
Exemplo n.º 5
0
 /// <summary>
 /// Sets input focus to a control.
 /// </summary>
 public void Focus(bool safe)
 {
     InnerTextBox?.Focus(safe);
 }
Exemplo n.º 6
0
 public void SelectAll()
 {
     InnerTextBox.SelectAll();
 }
 private void MetroTextBox_Click(object sender, EventArgs e)
 {
     InnerTextBox.Select();
 }