Results 1 to 3 of 3

Thread: [RESOLVED] [2005] Cancel New Line - Rich Text Box

  1. #1

    Thread Starter
    Hyperactive Member mrmojorisin's Avatar
    Join Date
    Oct 2007
    Location
    London Town Vocation: Garden Cricket Genuis
    Posts
    439

    Resolved [RESOLVED] [2005] Cancel New Line - Rich Text Box

    Morning all,

    What is the best way to cancel or stop a new line when you press the enter key in a Rich Text Box?

    Thanks
    Mojo

  2. #2
    Hyperactive Member gnaver's Avatar
    Join Date
    Jul 2005
    Location
    Denmark/Sweden
    Posts
    289

    Re: [2005] Cancel New Line - Rich Text Box

    in the keydown event

    vb Code:
    1. Private Sub RichTextBox1_KeyDown(ByVal sender As Object, ByVal e As System.Windows.Forms.KeyEventArgs) Handles RichTextBox1.KeyDown
    2.         If e.KeyCode = Keys.Enter Then
    3.             e.SuppressKeyPress = True
    4.         End If
    5.     End Sub

    dont know if it is the best way :S

  3. #3

    Thread Starter
    Hyperactive Member mrmojorisin's Avatar
    Join Date
    Oct 2007
    Location
    London Town Vocation: Garden Cricket Genuis
    Posts
    439

    Re: [2005] Cancel New Line - Rich Text Box

    Hey thanks. That will do the trick!

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width