public Panel Panel()
 {
     ActiveControl = SearchTextBox;
     SearchTextBox.Select();
     SearchTextBox.Focus();
     return(CustomerFormPanel);
 }
示例#2
0
        private void ChangeEditingStatus()
        {
            _product = new Product();
            ClearProductInputBoxes();
            SaveButton.Visible         = IsEditing;
            AddingRadioButton.Visible  = IsEditing;
            EditingRadioButton.Visible = !IsEditing;
            AddProductButton.Visible   = !IsEditing;
            SearchLabel.Visible        = IsEditing;
            SearchTextBox.Visible      = IsEditing;

            if (IsEditing) // -----when editing----
            {
                ProductsGridView.Visible = true;
                SearchTextBox.Select();
                AcceptButton = SaveButton;
                AddingRadioButton.Checked = false;
            }
            else // ----when adding----
            {
                ProductsGridView.Visible = false;
                ProductNameTextBox.Select();
                AcceptButton = AddProductButton;
                AddingRadioButton.Checked = true;
            }
        }
示例#3
0
 private void SearchTab_Enter(object sender, EventArgs e)
 {
     SearchTextBox.Select();
     SearchTextBox.Clear();
 }