Results 1 to 3 of 3

Thread: tab within RichTextBox

  1. #1

    Thread Starter
    Member
    Join Date
    Nov 2001
    Location
    Lincoln,England
    Posts
    60

    tab within RichTextBox

    Does anybody know how to allow the user to press the tab key within a RichTextBox and get a tab rather than moving to the next control?

    I have tried capturing the keypress event but it is not generated by the tab key.

    Thanks

  2. #2
    Bouncy Member darre1's Avatar
    Join Date
    May 2001
    Location
    Peterborough, UK
    Posts
    3,828
    try setting the forms keypreview property to true and capture the tab key in the forms_keypress event.

    NOTE: if the user pressed CTRL+Tab it would work ok too, but i doubt you want them to have to do that eh
    Confucious say, "Man standing naked in biscuit barrel not necessarily ****ing crackers."

    Don't forget to format your code in your posts

  3. #3
    Retired VBF Adm1nistrator plenderj's Avatar
    Join Date
    Jan 2001
    Location
    Dublin, Ireland
    Posts
    10,359
    Use KeyDown()
    KeyCode for tab is 9
    Microsoft MVP : Visual Developer - Visual Basic [2004-2005]

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