vb Code:
  1. Private ctrlM As Boolean = False
  2.  
  3. Private Sub TextBox1_KeyDown(ByVal sender As Object, _
  4.                              ByVal e As System.Windows.Forms.KeyEventArgs) Handles TextBox1.KeyDown
  5.     If e.KeyCode = Keys.M AndAlso _
  6.        e.Control AndAlso _
  7.        Not e.Shift AndAlso _
  8.        Not e.Alt Then
  9.         Me.TextBox1.AppendText("This is a comment.")
  10.         Me.ctrlM = True
  11.     End If
  12. End Sub
  13.  
  14. Private Sub TextBox1_KeyPress(ByVal sender As Object, _
  15.                               ByVal e As System.Windows.Forms.KeyPressEventArgs) Handles TextBox1.KeyPress
  16.     If e.KeyChar = ControlChars.Cr AndAlso Me.ctrlM Then
  17.         e.Handled = True
  18.         Me.ctrlM = False
  19.     End If
  20. End Sub