Ejemplo n.º 1
0
        private void Find_FindText_Checked(object sender, EventArgs e)
        {
            FindTextBox.Enabled = true;
            FindHexBox.Enabled  = false;

            FindTextBox.Focus();
        }
Ejemplo n.º 2
0
        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;
        }
Ejemplo n.º 3
0
 private void KeyUpEventHandler(object sender, KeyEventArgs e)
 {
     if (ModifierKeys.HasFlag(Keys.Control) && e.KeyCode == Keys.F)
     {
         FindTextBox.Focus();
         FindTextBox.Select(0, FindTextBox.TextLength);
     }
 }
Ejemplo n.º 4
0
        /// <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();
        }
Ejemplo n.º 5
0
 private void FindTextBox_Enter(object sender, EventArgs e)
 {
     // don't Select All unless we came from a different textbox
     if (m_lastTextBox != FindTextBox)
     {
         FindTextBox.SelectAll();
     }
     m_lastTextBox = FindTextBox;
 }
Ejemplo n.º 6
0
        private void FindTextBox_KeyUp(object sender, KeyEventArgs e)
        {
            if (e.KeyCode == Keys.Enter)
            {
                FindButton.PerformClick();

                FindTextBox.Focus();
                FindTextBox.Select(0, FindTextBox.TextLength);
            }
        }
Ejemplo n.º 7
0
 /// <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();
     }
 }
Ejemplo n.º 8
0
        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();
        }
Ejemplo n.º 9
0
 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();
 }
Ejemplo n.º 10
0
 protected void Page_Init(object sender, EventArgs e)
 {
     ProblemList = db.ProblemTrackers.Where(p => p.ProblemStatus_id == 2).ToList();
     FindTextBox.Focus();
 }
Ejemplo n.º 11
0
 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);
        }
 private void FindTextBox_GotFocus(object sender, RoutedEventArgs e)
 {
     FindTextBox.SelectAll();
 }