How to Set the Formatting Rectangle of a TextBoxLast reviewed: December 14, 1995Article ID: Q141021 |
The information in this article applies to:
SUMMARYYou can change the formatting rectangle of a text box to control when scrolling occurs. The formatting rectangle determines the range of positions allowed for the caret (text cursor). The limiting rectangle is independent of the size of the edit-control window. By default, the formatting rectangle is the same as the client area of the edit-control window.
MORE INFORMATIONUsing the SendMessage API call and the EM_SETRECT message, you can set the formatting rectangle of a text box. If you do not send the EM_SETRECT message, the formatting rectangle defaults to the size of the client area of the text box. You can use this API call to control where the scrolling starts in a text box. The default scrolling starts when the cursor reaches the left side of the text box. This API can make that rectangle smaller than the actual text box forcing the scrolling to start before the cursor reaches the left side of the text box. Note the following if you do not use the message until after text has been entered into the text box: If the text box does not have a horizontal scroll bar, and the formatting rectangle is set to be larger than the text box window, lines of text exceeding the width of the text box (but smaller than the width of the formatting rectangle) are clipped instead of wrapped.
Step-by-Step Demonstration
|
Additional reference words: 2.00 3.00 4.00 vb4win vb416
© 1998 Microsoft Corporation. All rights reserved. Terms of Use. |