Beispiel #1
0
        private void TextBox1_GotFocus(object sender, System.EventArgs e)
        {
            if (IgnoreEvents == 0 && this.TemporaryReadOnly == false && this.ReadOnly == false)
            {
                if (m_TemporaryReadOnly == false && this.ReadOnly == false)
                {
                    if (m_TemporaryReadOnly == false && this.ReadOnly == false)
                    {
                        switch (this.DataType)
                        {
                        case DataTypes.Currency:
                        case DataTypes.Date:
                        case DataTypes.Float:
                        case DataTypes.Integer:
                        case DataTypes.Stock:
                            TextBox1.SelectAll();
                            break;

                        default:
                            TextBox1.Select(TextBox1.Text.Length, 0);
                            break;
                        }
                    }
                    else
                    {
                        TextBox1.Select(TextBox1.Text.Length, 0);
                    }
                }
                else
                {
                    TextBox1.Select(TextBox1.Text.Length, 0);
                }
            }
        }
Beispiel #2
0
 private void TextBox1OnGotFocus(object sender, EventArgs eventArgs)
 {
     if (!string.IsNullOrEmpty(TextBox1.Text))
     {
         //Saco el formato currency
         TextBox1.Text = TextBox1.Text.Replace("%", "").Replace(".", "");
         TextBox1.SelectAll();
     }
 }
Beispiel #3
0
 public void TextBox1_KeyDown(object sender, KeyEventArgs e)
 {
     if (e.Key == Key.Enter)
     {
         //TextBox1.MoveFocus(traversalRequest);
         TextBox1_LostFocus(this, null);
         TextBox1.SelectAll();
     }
     if (e.Key == Key.Subtract)
     {
         var box   = (TextBox)sender;
         var text  = box.Text;
         var caret = box.CaretIndex;
         if (box.SelectionLength > 0)
         {
             text = text.Substring(0, box.SelectionStart) + text.Substring(box.SelectionStart + box.SelectionLength);
         }
         box.Text       = text.Insert(box.CaretIndex, "-");
         box.CaretIndex = caret + 1;
         e.Handled      = true;
     }
 }
Beispiel #4
0
 private void SelectAll1_Click(object sender, EventArgs e)
 {
     TextBox1.SelectAll();
     CopyToolStripButton.Enabled = CutToolStripButton.Enabled = (TextBox1.SelectionLength > 0);
 }
Beispiel #5
0
 private void TextBox1_Leave(object sender, EventArgs e)
 {
     Check_AlarmStatus();
     TextBox1.SelectAll();
 }
 private void SelectAll_Click(object sender, RoutedEventArgs e)
 {
     TextBox1.Focus();
     TextBox1.SelectAll();
 }