Guest User

Untitled

a guest
Apr 21st, 2018
80
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.03 KB | None | 0 0
  1. private Point rtfLocation;
  2.  
  3. private void textBox1_MouseDown(object sender, MouseEventArgs e)
  4. {
  5. if (MouseButtons == MouseButtons.Right)
  6. {
  7. rtfLocation = this.PointToClient(textBox1.PointToScreen(new Point(e.X, e.Y)));
  8. textBox1.ShortcutsEnabled = false;
  9. richTextBox1.Location = rtfLocation;
  10. richTextBox1.Show();
  11. }
  12. }
  13.  
  14. private void richTextBox1_MouseDoubleClick(object sender, MouseEventArgs e)
  15. {
  16. richTextBox1.Hide();
  17. }
  18.  
  19. private void richTextBox1_Leave(object sender, EventArgs e)
  20. {
  21. richTextBox1.Hide();
  22. }
  23.  
  24. private void Form1_Click(object sender, EventArgs e)
  25. {
  26. if (richTextBox1.Visible)
  27. {
  28. richTextBox1.Hide();
  29. }
  30. }
  31.  
  32. private void textBox1_Click(object sender, EventArgs e)
  33. {
  34. if (richTextBox1.Visible) richTextBox1.Hide();
  35. }
  36.  
  37. private void richTextBox1_VisibleChanged(object sender, EventArgs e)
  38. {
  39. textBox1.ShortcutsEnabled = ! richTextBox1.Visible;
  40. }
Add Comment
Please, Sign In to add comment