AddStyle

                              +----------------+
                              V                |
>>-anEditControl~AddStyle(--"---+-UPPER------+-+--"--)---------><
                                +-LOWER------+
                                +-NUMBER-----+
                                +-WANTRETURN-+
                                +-OEM--------+
                                +-TAB--------+
                                +-GROUP------+

Adds one or more edit control styles to the edit control. 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.

Arguments:

The style argument can be one or more of the following keywords. (Each keyword is separated by a blank.):

UPPER

Converts all characters to uppercase as they are typed into the edit control.

LOWER

Converts all characters to lowercase as they are typed into the edit control.

NUMBER

Only allows digits to be typed into the edit control. If the user types an non-digit character an information balloon is displayed informing the user that only digits are allowd. This style does not prevent the user from pasting non-digits into the control.

WANTRETURN

This keyword only effects multi-line edit controls. With this style when a user hits the enter key the line break characters are inserted into the text buffer. Without the style, when the user hits enter the default push button of the dialog is pressed.

OEM

Converts text entered in the edit control from the Windows character set to the OEM character set and then back again to the Windows character set. This ensures proper character conversion in certain circumstances. Microsoft states that this style is most useful when edit controls contain file names that will be used with file systems that do not support Unicode. For further details see the Windows documentation provided by Microsoft.

TAB

Adds the tabstop tab stop style.

GROUP

Adds the group style.

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.

-3

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

-2

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

-1

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

other

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

Example:

This example shows the syntax to add the number, tabstop, and group styles to an edit control.

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