public GridSpeedSearch(DBGridBase gridControl, ToolStripTextBox findControl) { _grid = gridControl; txtFind = findControl; txtFind.ToolTipText = "Быстрый поиск"; //txtFind.TextChanged += new EventHandler(txtFind_TextChanged); txtFind.Validated += new EventHandler(txtFind_TextChanged); txtFind.Leave += new EventHandler((sender, e) => { searchColName = string.Empty; }); txtFind.KeyDown += new KeyEventHandler((sender, e) => { if (e.KeyCode == Keys.Enter || e.KeyCode == Keys.Down) { _grid.Focus(); } }); _grid.KeyPress += new KeyPressEventHandler((sender, e) => { if (char.IsLetterOrDigit(e.KeyChar)) { txtFind.Focus(); SendKeys.Send("{END}"); txtFind.Text += e.KeyChar.ToString(); } }); _grid.KeyDown += (sender, e) => { if (e.KeyCode == Keys.Back) { int len; string text = txtFind.Text; if ((len = text.Length) > 1) { txtFind.Text = text.Left(len - 1); txtFind.Focus(); SendKeys.Send("{END}"); } else { this.Clear(); } } }; errToolTip = new ToolTip { ToolTipIcon = ToolTipIcon.Error }; }
public void F03_Action(object sender, EventArgs e) { if (_controller.TabGrid.CurrentGridView.CurrentCell == null) { return; } var F3_Search = ((ToolStripMenuItem)sender); var toolText = new ToolStripTextBox("toolText"); F3_Search.DropDownItems.Add(toolText); _controller.TabGrid.CurrentGridView.CurrentCell = _controller.TabGrid.CurrentGridView.Rows[0].Cells[0]; toolText.KeyDown += (object _sender, KeyEventArgs _e) => { if (_e.KeyCode == Keys.Enter) { FocusDataGridViewCell(toolText.Text); } toolText.KeyDown += null; }; F3_Search.DropDownClosed += (object _sender, EventArgs _e) => { F3_Search.DropDownItems.Remove(F3_Search.DropDownItems["toolText"]); }; F3_Search.ShowDropDown(); toolText.Focus(); }
public void OnTakeFocus(bool next) { // Fired when Chromium is giving up focus because the user // pressed Tab on the last link/field in the HTML document (in which case 'next' is true) // or because they pressed Shift+Tab on the first link/field (in which case 'next' is false). // Here we always focus on the address bar. urlTextBox.Control.BeginInvoke(new MethodInvoker(() => urlTextBox.Focus())); }
public void FocusOnSearchEdit() { if (Searchbox == null) { throw new Exception("No searchbox defined in Findbar"); } Searchbox.Focus(); }
// The dropdown has opened. void OpenedDropdown(object sender, EventArgs args) { // If there's a textbox control, it gets the initial focus. if (textbox != null) { textbox.SelectAll(); textbox.Focus(); } }
void frameNumberIndicator_DoubleClick(object sender, EventArgs e) { statusStrip.SuspendLayout(); statusStrip.Items.Remove(frameNumberLabel); statusStrip.Items.Insert(statusStrip.Items.Count - 1, frameNumberTextBox); frameNumberTextBox.Size = frameNumberLabel.Size; frameNumberTextBox.Text = frameNumberLabel.Text; statusStrip.ResumeLayout(); frameNumberTextBox.Focus(); }
public void ShowRename() { DropDownItems.Add(toolText); DropDownClosed += This_DropDownClosed; toolText.KeyDown += new KeyEventHandler(This_KeyDown); toolText.Text = Text; ShowDropDown(); toolText.Focus(); }
void btn_Click(object sender, EventArgs e) { if (string.IsNullOrEmpty(txt.Text)) { MessageBox.Show("Masukkan kata kunci !!", AppCode.AssemblyProduct, MessageBoxButtons.OK, MessageBoxIcon.Information); txt.Focus(); } else { BindData(combo.SelectedIndex, "%" + txt.Text + "%"); } }
private void OnClickFuncName(object sender, EventArgs e) { ToolStripTextBox tstb = new ToolStripTextBox(); ToolStripButton tsb = ((ToolStripButton)sender); ToolStrip ts = ((ToolStripButton)sender).GetCurrentParent(); tsb.Visible = false; tstb.Text = tsb.Text; tstb.AutoSize = true; tstb.Name = "tstb"; tstb.KeyPress += Tstb_KeyPress; tstb.LostFocus += Tstb_LostFocus; ts.Items.Add(tstb); tstb.Focus(); }
private void tstxtMileageCheck_Leave(object sender, EventArgs e) { ToolStripTextBox txt = sender as ToolStripTextBox; if (string.IsNullOrEmpty(txt.Text)) { txt.Text = "0"; } else { double number = 0; if (!double.TryParse(txt.Text.Trim(), out number)) { txt.Text = string.Empty; txt.Focus(); } } }
private void tsbGoto_Click(object sender, EventArgs e) { int index; if (int.TryParse(tstPageIndex.Text.Trim(), out index) && index >= 1 && index <= this.Pages) { if (index == this.PageIndex) { return; } else { this.PageIndex = index; this.Paging(sender); } } else { TXMessageBoxExtensions.Warning("请输入有效的页数!"); tstPageIndex.Focus(); tstPageIndex.SelectAll(); } }
public void Focus() { textbox.Focus(); }
/// <summary> /// Clears the searched, found, and highlighted Treenode. /// </summary> /// <param name="sender"></param> /// <param name="e"></param> internal void OnClearHighlightClick(object sender, EventArgs e) { XCMainWindow.Instance.ClearSearched(); _tstbSearch.Focus(); }
public void FocusSearchTextBox() { _textBox.SelectAll(); _textBox.Focus(); }