HeaderPane
Main
Hide
Share Link
Print

AutoSize

Defines whether a control sizes itself.

C

BOOL WINAPI SftDate_GetAutoSize(HWND hwndCtl);
void WINAPI SftDate_SetAutoSize(HWND hwndCtl, BOOL fAutoSize);

C++

BOOL CSftDate::GetAutoSize() const;
BOOL CSftCalendar::GetAutoSize() const;
void CSftDate::SetAutoSize(BOOL fAutoSize);
void CSftCalendar::SetAutoSize(BOOL fAutoSize);

Parameters

hwndCtl

The window handle of the date field control (SftDate) or the month calendar control (SftCalendar).

fAutoSize

TRUE if the control sizes itself, otherwise FALSE.

Returns

GetAutoSize returns TRUE if the control sizes itself, otherwise FALSE.

Comments

The GetAutoSize and SetAutoSize functions define and retrieve whether a control adjusts its window size to its contents. The default is TRUE.

A date field control that sizes itself keeps the height its font and border require (GetPreferredHeight); the application defines its width. A month calendar control that sizes itself takes the size of the months it shows (GetPreferredSize), including the Today and Clear buttons and the border, and keeps its top left corner.

The size is adjusted when a setting, the font, the culture or the DPI of the monitor changes. A month calendar control that doesn't size itself centers the months in its window and stretches the days to fill a larger window.

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


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