コード例 #1
0
ファイル: Form1.cs プロジェクト: emiminoiu/TextEditorApp
 private void richTextBox1_KeyPress(object sender, KeyPressEventArgs e)
 {
     if (e.Equals(Keys.Z))
     {
         Undoer undoer = null;
         foreach (var x in dictionary)
         {
             if (x.Key.Equals(tabFiles.SelectedTab.Controls[1]))
             {
                 undoer = x.Value;
             }
         }
         undoer.UndoWords();
         e.Handled = true;
     }
     if (e.Equals(Keys.Y))
     {
         Undoer undoer = null;
         foreach (var x in dictionary)
         {
             if (x.Key.Equals(tabFiles.SelectedTab.Controls[1]))
             {
                 undoer = x.Value;
             }
         }
         undoer.RedoWords();
         e.Handled = true;
     }
 }
コード例 #2
0
 private void tbAndar_KeyPress(object sender, KeyPressEventArgs e)
 {
     if ((!char.IsNumber(e.KeyChar) && !(e.KeyChar == 8)) || (e.Equals(Keys.Control)))
     {
         e.Handled = true;
     }
 }
コード例 #3
0
        private void txtbSearch_KeyPress(object sender, KeyPressEventArgs e)
        {
            if (e.Equals("{ENTER}"))
            {
                listBox1.Items.Clear();

                foreach (userMessages mess in goog.allMessages.Values)
                {
                    if (mess.TITLE.Contains(txtbSearch.Text))
                    {
                        listBox1.Items.Add(mess);
                    }
                }
            }
        }
コード例 #4
0
        private void tbValor_KeyPress(object sender, KeyPressEventArgs e)
        {
            if (tbValor.Text.Contains(","))
            {
                if ((!char.IsNumber(e.KeyChar) && !(e.KeyChar == 8)) || (e.Equals(Keys.Control)))
                {
                    e.Handled = true;
                }
            }

            if ((!char.IsNumber(e.KeyChar) && !(e.KeyChar == ',') && !(e.KeyChar == 8)) || (e.Equals(Keys.Control)))
            {
                e.Handled = true;
            }
        }