hStatic = WinXAddStatic (parent, STRING title, hImage, style, id)
Adds a new static (label) control to the specified window.
Parameter | Description |
---|---|
parent | The window to add this control to |
STRING title | The text to appear in the control, or if this control displays an image, "bitmap" or "icon" depending on what kind of handle is specified by hImage |
hImage | The handle to the image to display in this static control, or 0 if this static control does not display an image |
style | The window style for the static control. See the remarks section |
id | The unique id of the static control |
A handle to the static control or 0 on fail.
The style parameter takes a standard window style. Listed are some of more usefull constants. See the Win32 documentation for a complete list. These constants can be combine with the | (or) operator.
The size and position of the static control is set using either a custom control sizer function (controlSizer callback) or the auto sizer. To use the auto sizer, use the WinXAutoSizer_SetInfo function.
'define constants for the static controls $$IDSTATIC1 = 100 $$IDSTATIC2 = 101 'make a button with text hStatic1 = WinXAddStatic (#hMain, "Click me", 0, $$SS_LEFT, $$IDSTATIC1) 'make a button using an icon loaded from the resource file hImage = LoadIconA (GetModuleHandleA (0), &"mainIcon") hStatic2 = WinXAddStatic (#hMain, "icon", hImage, $$SS_ICON, $$IDSTATIC2) |