HeaderPane
Main
Hide
Share Link
Print

EditAlign

Defines the text alignment in the edit control portion.

C

int WINAPI SftBox_GetEditAlign(HWND hwndCtl);
void WINAPI SftBox_SetEditAlign(HWND hwndCtl, int style);

C++

int CSftBox::GetEditAlign() const;
void CSftBox::SetEditAlign(int style);

Parameters

hwndCtl

The window handle of the combo box control.

style

Defines the text alignment in the edit control portion. style can be one of the following values:

ES_LEFTThe text is left aligned. This is the default.
ES_CENTERThe text is centered.
ES_RIGHTThe text is right aligned.
-1The text is aligned based on the cell text alignment of the first displayed column (see SFTBOX_COLUMN, style).

Returns

GetEditAlign returns the current text alignment (see style above).

Comments

The GetEditAlign and SetEditAlign functions define the text alignment in the edit control portion of a simple or dropdown combo box.

If an invalid style value is specified, the SetEditAlign function call is ignored.

When the alignment is changed, the edit control is destroyed and a new edit control is created. A window handle previously retrieved using GetHWNDEdit is no longer valid. The SFTBOXN_EDITCREATED notification is sent to the parent window once the new edit control has been created. The edit control then shows the text of the currently selected item. Text entered by the user that has not resulted in an item selection is lost.

If -1 is used, the edit control is also created again when the user reorders the columns using the column headers shown in the static portion, as the first displayed column may have changed. The edit control is always created again when SetColumns is called.

A dropdown list combo box does not have an edit control portion, so the alignment is not used. The alignment of the text shown in the static portion is defined by the columns (see SetColumns).

See Also C/C++ API | Categories | Notifications


Last Updated 11/21/2026 - (email)
© 2026 Softel vdm, Inc.