ACC97: Using Tab Key to Insert Tab Character in RichText Control (170141)
The information in this article applies to:
This article was previously published under Q170141 Moderate: Requires basic macro, coding, and interoperability skills.
SUMMARY
In a RichTextBox control, the default behavior of the TAB key is to move
the focus to the next control in the tab order of a form. This article
shows you how you can use the TAB key to insert a tab character into a
RichTextBox control.
The sample function ctlRichText1_KeyDown() traps for the TAB key in the
KeyDown event of the RichTextBox control. It prevents the control from
losing focus, and then uses the SelText property of the control to insert
the tab.
REFERENCES
For more information about the methods and properties of the RichTextBox
control, open a module in a database containing a form with a RichTextBox
control and press F2. In the Object Browser, select RichTextLib from the
list of Libraries, and then select RichTextBox from the list of Classes.
Modification Type: | Major | Last Reviewed: | 9/26/2003 |
---|
Keywords: | kbcode kbhowto kbinterop KB170141 |
---|
|