Eyooper
asked on
How do you change TABSTOPS in an edit control?
I've written an application using MASM and I'm trying to change the default tabstops in my edit control
using:
TS DWORD 40
.
.
.
INVOKE SendMessage, hREdit, EM_SETTABSTOPS, 1, TS
The return is zero which means it did not process.
I don't need to set up an array for variable length Stops.
Thanks,
Ewayne
using:
TS DWORD 40
.
.
.
INVOKE SendMessage, hREdit, EM_SETTABSTOPS, 1, TS
The return is zero which means it did not process.
I don't need to set up an array for variable length Stops.
Thanks,
Ewayne
ASKER
I'm using a MULTILINE EDIT CONTROL for my text editor program, everything is working great, except I would like to change the tabstop spaces
I smell a rat! The hREdit is a handle to Rich Edit control, isn't? In which case you can't use it. Extract from Microsoft documentation :-
EM_SETTABSTOPS (Rich edit controls use the EM_SETPARAFORMAT message instead.)
The EM_SETPARAFORMAT message sets the paragraph formatting for the current selection in a rich edit control.
EM_SETPARAFORMAT
wParam = 0; // not used; must be zero
lParam = (LPARAM) (PARAFORMAT FAR *) lpFmt;
Parameters
lpFmt
Pointer to a PARAFORMAT structure specifying the new paragraph formatting attributes. Only the attributes specified by the dwMask member are changed.
Rich Edit 2.0 and later: This parameter can be a pointer to a PARAFORMAT2 structure, which is an extension of the PARAFORMAT structure. Before sending the EM_SETPARAFORMAT message, set the structure's cbSize member to indicate the version of the structure.
Return Values
Returns a nonzero value if successful, or zero otherwise.
Do you need the data structure or do you have it somewhere?
EM_SETTABSTOPS (Rich edit controls use the EM_SETPARAFORMAT message instead.)
The EM_SETPARAFORMAT message sets the paragraph formatting for the current selection in a rich edit control.
EM_SETPARAFORMAT
wParam = 0; // not used; must be zero
lParam = (LPARAM) (PARAFORMAT FAR *) lpFmt;
Parameters
lpFmt
Pointer to a PARAFORMAT structure specifying the new paragraph formatting attributes. Only the attributes specified by the dwMask member are changed.
Rich Edit 2.0 and later: This parameter can be a pointer to a PARAFORMAT2 structure, which is an extension of the PARAFORMAT structure. Before sending the EM_SETPARAFORMAT message, set the structure's cbSize member to indicate the version of the structure.
Return Values
Returns a nonzero value if successful, or zero otherwise.
Do you need the data structure or do you have it somewhere?
ASKER
I accept
Thanks
Thanks
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER
Adjusted points to 100
The EM_SETTABSTOPS message positions the tab stops for a MULTILINE EDIT CONTROL. Single line edit controls do not process this message, they just return zero!