+---------------+     +---------------+
                                V               |     V               |
                                  +-LOWER-----+         +-LOWER-----+
                                  +-NUMBER----+         +-NUMBER----+
                                  +-WANTRETURN+         +-WANTRETURN+
                                  +-OEM-------+         +-OEM-------+
                                  +-TAB-------+         +-TAB-------+
                                  +-GROUP-----+         +-GROUP-----+

Removes and adds edit control styles for the edit control in one operation. This method works with the window styles that can be changed by accessing the edit control window directly after the edit control has been created.


The two arguments can be one or more of the style keywords. (Each keyword is separated by a blank.) See the argument list for the AddStyle method for detals on the keywords.


The first argument is the list of styles to remove.


The second argument is the list of styles to add.

Return value:

Negative values indicate error, non-negative values indicate success.

-4 or less

The value is the negated Operating System Error code. The absolute value of the return can be used to look up the error reason in the Windows documentation.


The was no valid keyword in one or both of the style arguments. Note that if a style argument contains at least one valid keyword other invalid keywords are then ignored.


There is an (internal) problem with the dialog or the dialog handle.


There is an (internal) problem with the resource ID or window handle of the edit control.


The numeric value of the edit control's previous style.


The following would change an edit control from one that only allows numbers to one that uppercases all letters entered, while removing the tabstop style and adding the group style.

editControl = dlg~getEditControl(IDC_ENTRYLINE)
if .nil == editControl then return
editControl~replaceStyle("NUMBER TAB", "UPPER GROUP")