|
|
|
By default, multiline TextBox controls insert a tab stop position every 8 characters; in other words, if you press the Ctrl+Tab key while the focus is inside a multiline TextBox control, the caret advances to position 8,16,24, etc. (If the TextBox is the only control on the form that can receive the focus in that moment, you can also advance to the next tab stop with the Tab key.)
By sending the control a EM_SETTABSTOPS message, you can set individual tab stops at desired positions. You do so by loading an array of Longs with the position of individual tab stops, expressed in dialog units - where each dialog unit is 1/4 of the average character width. Then you pass the array to the SendMessage function, specifying the number of elements in wParam and the first element of the array in lParam. Here's an example: |
The following routine encapsulates this call for you: |
The simplest case is when all the tab stops have the same distance, in which case you can use the following routine: |
|
|
|
Submitted By :
Nayan Patel
(Member Since : 5/26/2004 12:23:06 PM)
|
|
|
Job Description :
He is the moderator of this site and currently working as an independent consultant. He works with VB.net/ASP.net, SQL Server and other MS technologies. He is MCSD.net, MCDBA and MCSE. In his free time he likes to watch funny movies and doing oil painting. |
View all (893) submissions by this author
(Birth Date : 7/14/1981 ) |
|
|