Guest User

Untitled

a guest
Jun 13th, 2018
92
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.39 KB | None | 0 0
  1. private void Form_KeyPress(object sender, KeyPressEventArgs e)
  2. {
  3. if (e.KeyChar == (char)Keys.Enter && this.ActiveControl != theRichTextBox)
  4. {
  5. this.DialogResult = DialogResult.OK;
  6. }
  7. }
  8.  
  9. private void RichTextBox_Enter(object sender, EventArgs e)
  10. {
  11. this.AcceptButton = null;
  12. }
  13.  
  14. private void RichTextBox_Leave(object sender, EventArgs e)
  15. {
  16. this.AcceptButton = btnAccept;
  17. }
Add Comment
Please, Sign In to add comment