BCX_GROUP function
Purpose:
BCX_GROUP creates a rectangle in which other
controls can be grouped. Any text associated with this style is
displayed in the rectangle's upper left corner.
Syntax:
hCtl = BCX_GROUP(Text AS STRING, _
hwndParent AS HWND, _
hCtlID AS INTEGER, _
Xpos AS INTEGER, _
Ypos AS INTEGER, _
Width AS INTEGER, _
Height AS INTEGER _
[, WinStyle AS INTEGER] _
[, ExWinStyle AS INTEGER])
Return Value:
- Data type: HWND
hCtl The handle of the new group box if the
function succeeds. If the function fails, the return value is
NULL.
Parameters:
- Data type: HWND
hCtl The return value is a handle of the new
group box if the function succeeds. If the function fails, the
return value is NULL.
- Data type: STRING
Text Label for the group box.
- Data type: HWND
hwndParent The handle of the parent window
of the group box being created.
- Data type: INTEGER
hCtlID Specifies the identifier of the group
box being created. The identifier is an integer value used by the
group box being created to notify its parent about events. The
identifier must be unique for each control created with the same
parent window.
- Data type: INTEGER
Xpos Specifies the initial horizontal
x-coordinate value of the upper-left corner location of the group
box being created relative to the upper-left corner of the parent
window's client area.
- Data type: INTEGER
Ypos Specifies the initial vertical
y-coordinate value of the upper-left corner location of the group
box being created relative to the upper-left corner of the parent
window's client area.
- Data type: INTEGER
Width Specifies the width, in device units
or, if the PIXELS optional parameter was specified in the
GUI statement, in pixels, of the group box being
created.
- Data type: INTEGER
Height Specifies the height, in device units
or, if the PIXELS optional parameter was specified in the
GUI statement, in pixels, of the group box being
created.
- Data type: INTEGER
WinStyle [OPTIONAL]
If the WinStyle parameter is used, the
default Window Style for a BCX_GROUP
control, WS_CHILD | BS_GROUPBOX | WS_VISIBLE, is replaced with the
value in WinStyle. For more information,
visit the Microsoft Button Control Styles webpage and the
Microsoft Window Styles webpage.
- Data type: INTEGER
ExWinStyle [OPTIONAL]
The default Extended Window Style for a BCX_GROUP
control is 0. For more information, visit the Microsoft Extended Window Styles webpage.
|
Result:
If the group box was created, the return value is the handle of
the new group box. If the function fails, the return value is
NULL.
Remarks:
The default window Style for a BCX_GROUP
control also can be changed by using the MODSTYLE function.
Example:
GUI "Move Multiple Controls in a BCX_GROUP",PIXELS
MACRO IDBTN = 100
DIM hFRM AS HWND
DIM hCTL[3] AS HWND
DIM hBTN AS HWND
DIM bToggle AS BOOL
'--------------------------------------------------------------
SUB FORMLOAD()
'--------------------------------------------------------------
hFRM = BCX_FORM("Move Multiple Controls", 0, 0, 310, 230)
hBTN = BCX_BUTTON("Click Me",hFRM,IDBTN,210,160,80,26)
hCTL[0] = BCX_GROUP("BCX_GROUP Control a child of hFRM",hFRM,0,10,10,380,100)
hCTL[1] = BCX_LABEL("I'm the 1st child of hCTL[0]",hCTL[0],0,20,20,200,26)
hCTL[2] = BCX_LABEL("I'm the 2nd child of hCTL[0]",hCTL[0],0,20,40,200,26)
CENTER(hFRM)
SHOW(hFRM)
END SUB
'--------------------------------------------------------------
BEGIN EVENTS
'--------------------------------------------------------------
IF (CBMSG = WM_COMMAND) && (LOWORD(wParam) = IDBTN) THEN
bToggle = NOT bToggle
' note: we're only moving the group control...
MoveWindow(hCTL[0],10,IIF(bToggle,50,10),380,100,TRUE)
END IF
END EVENTS