EM_SETTABSTOPS

3.0

EM_SETTABSTOPS
wParam = (WPARAM) cTabs;                       /* number of tab stops */
lParam = (LPARAM) (const int FAR*) lpTabs;     /* tab-stop array      */

An application sends an EM_SETTABSTOPS message to set the tab stops in a multiline edit control (MLE). When text is copied to an MLE, any tab character in the text causes space to be generated up to the next tab stop.

This message is processed only by MLEs.

Parameters

cTabs

Value of wParam. Specifies the number of tab stops contained in the lpTabs parameter. If this parameter is 0, the lpTabs parameter is ignored and default tab stops are set at every 32 dialog box units. If this parameter is 1, tab stops are set at every n dialog box units, where n is the distance pointed to by the lpTabs parameter. If the cTabs parameter is greater than 1, lpTabs points to an array of tab stops.

lpTabs

Low and high-order words of lParam. Points to an array of unsigned integers specifying the tab stops, in dialog box units. If the cTabs parameter is 1, lpTabs points to an unsigned integer containing the distance between all tab stops, in dialog units.

Return Value

The return value is nonzero if the tabs were set; otherwise, the return value is zero.

Comments

The EM_SETTABSTOPS message does not automatically redraw the edit-control window. If the application is changing the tab stops for text already in the edit control, it should call the InvalidateRect function to redraw the edit-control window.

Example

This example sends an EM_SETTABSTOPS message to set tab stops at every 64 dialog box units. It then calls InvalidateRect to redraw the edit-control window.

WORD wTabSpacing = 64;

SendDlgItemMessage(hdlg, ID_MYEDITCONTROL,
    EM_SETTABSTOPS, 1, (LPARAM) (int far*) &wTabSpacing);
InvalidateRect(GetDlgItem(hdlg, ID_MYEDITCONTROL),
    NULL, TRUE);

See Also

GetDialogBaseUnits