private async Task SearchByAmount() { ClearError(); FindButton.Enabled = false; ResultsDataGridView.DataSource = null; ResultsDataGridView.Rows.Clear(); ResultsDataGridView.Columns.Clear(); StartCountLoadingEffect(); string userSearchText = FindTextBox.Text.TrimEnd(); var success = Decimal.TryParse(userSearchText, out decimal result); if (success) { List<Invoice> invoices = await service.GetInvoicesByTranAmtAsync(result, (int)LimitNumeric.Value); PopulateDataGridView(invoices); } else { ErrorOccured("Error - Cannot convert input into number"); FindTextBox.Focus(); FindTextBox.Select(0, FindTextBox.Text.Length); CountLabel.Text = "0"; } FindButton.Enabled = true; }
private void Find_FindText_Checked(object sender, EventArgs e) { FindTextBox.Enabled = true; FindHexBox.Enabled = false; FindTextBox.Focus(); }
private void KeyUpEventHandler(object sender, KeyEventArgs e) { if (ModifierKeys.HasFlag(Keys.Control) && e.KeyCode == Keys.F) { FindTextBox.Focus(); FindTextBox.Select(0, FindTextBox.TextLength); } }
/// <summary> /// Opens the Quick Find box. The word under the cursor is automatically /// filled into the Find field. /// </summary> /// <param name="replace">A boolean value specifying whether we want Replace functionality.</param> public void Open(bool replace = false) { bool wasVisibleBefore = Visible; ApplyStyle(StyleManager.Style); SuspendLayout(); TitleLabel.Text = replace ? "Quick Replace" : "Quick Find"; BringToFront(); Show(); // populate the Find term from the current selection if (!wasVisibleBefore) { if (string.IsNullOrEmpty(m_codeBox.SelectedText)) { // if no selection, use word under cursor int wordStart = m_codeBox.WordStartPosition(m_codeBox.CurrentPosition, false); int wordEnd = m_codeBox.WordEndPosition(m_codeBox.CurrentPosition, false); if (!wasVisibleBefore) { m_codeBox.TargetStart = wordStart; FindTextBox.Text = m_codeBox.GetWordFromPosition(m_codeBox.CurrentPosition); } } else if (!m_codeBox.SelectedText.Contains('\r') && !m_codeBox.SelectedText.Contains('\n')) { // if there is a selection, use it as the search term unless it contains newlines m_codeBox.TargetStart = m_codeBox.SelectionStart; FindTextBox.Text = m_codeBox.SelectedText; } else { FindTextBox.Text = ""; } if (!string.IsNullOrEmpty(FindTextBox.Text)) { PerformFind(); } } FindTextBox.Focus(); FindTextBox.SelectAll(); ReplaceTextBox.Visible = replace; ReplaceButton.Visible = replace; ReplaceAllButton.Visible = replace; if (replace) { Height = m_fullHeight; } else { Height = m_fullHeight - ReplaceTextBox.Height; } ResumeLayout(); }
private void FindTextBox_KeyUp(object sender, KeyEventArgs e) { if (e.KeyCode == Keys.Enter) { FindButton.PerformClick(); FindTextBox.Focus(); FindTextBox.Select(0, FindTextBox.TextLength); } }
/// <summary> /// Is called when this find window is activated /// </summary> void Core_OnFocus(object sender, EventArgs e) { if (FindTextRadioBox.Checked) { FindTextBox.Focus(); } else { FindHexBox.Focus(); } }
public Find() { InitializeComponent(); FindTextBox.Focus(); FindTextBox.TextChanged += (sender, args) => RecalculateNextMatch(); RegExCheckBox.Checked += (sender, args) => RecalculateNextMatch(); RegExCheckBox.Unchecked += (sender, args) => RecalculateNextMatch(); CaseSensitiveCheckBox.Checked += (sender, args) => RecalculateNextMatch(); CaseSensitiveCheckBox.Unchecked += (sender, args) => RecalculateNextMatch(); }
private void DoFind(object sender, ExecutedRoutedEventArgs e) { if (!Body.Selection.IsEmpty) { FindTextBox.Text = Body.Selection.Text; } if (FindTextBox.Text.Length == 0) { FindTextBox.Text = "Enter Search Text"; } FindTextBox.Focus(); }
protected void Page_Init(object sender, EventArgs e) { ProblemList = db.ProblemTrackers.Where(p => p.ProblemStatus_id == 2).ToList(); FindTextBox.Focus(); }
public FnRWindow() { InitializeComponent(); FindTextBox.Focus(); }
//------------------------------------------------------ // // Private Methods // //------------------------------------------------------ #region Private Methods /// <summary> /// Called to give the FindTextBox focus using a dispatcher. /// </summary> /// <param name="param">Not used.</param> /// <returns>null</returns> private object OnGoToTextBox(object param) { FindTextBox.Focus(); return(null); }