Пример #1
0
 private void checkFocus(MaterialSingleLineTextField textBox)
 {
     if (textBox.Text.Equals(""))
     {
         textBox.Focus();
     }
 }
 internal static void AutocompletionListKeyDown(MaterialSingleLineTextField textField, ListBox autocompleteList, Keys keyCode)
 {
     if (keyCode == Keys.Enter)
     {
         if (autocompleteList.SelectedItem != null)
         {
             textField.Text           = autocompleteList.SelectedItem.ToString();
             autocompleteList.Visible = false;
         }
         textField.Focus();
     }
     else if (keyCode == Keys.Up && autocompleteList.SelectedIndex == 0)
     {
         textField.Focus();
     }
 }
Пример #3
0
 private void CheckValid(MaterialSingleLineTextField textBox)
 {
     if (textBox.Text.Equals(""))
     {
         MessageBox.Show("bạn cần điền đủ thông tin");
         textBox.Focus();
     }
 }
Пример #4
0
 /// <summary>
 /// Raises the <see cref="E:System.Windows.Forms.Control.GotFocus" /> event.
 /// </summary>
 /// <param name="e">An <see cref="T:System.EventArgs" /> that contains the event data.</param>
 protected override void OnGotFocus(System.EventArgs e)
 {
     base.OnGotFocus(e);
     MaterialTB.Focus();
     MaterialTB.SelectionLength = 0;
 }