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$, _
hWndParent, _
hCtlID%, _
Xpos%, _
Ypos%, _
Width%, _
Height% _
[,WinStyle%] _
[,ExWinStyle%])
Parameters:
- hCtl The return value is a handle to the new group box
if the function succeeds. If the function fails, the return value
is NULL.
- Text$ Label for the group box.
- hWndParent Handle to the parent window of the group box
being created.
- 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.
- Xpos% Specifies the initial horizontal position of the
group box being created. X% is the x-coordinate of the upper-left
corner of the group box being created relative to the upper-left
corner of the parent window's client area.
- Ypos% Specifies the initial vertical position of the
group box being created. Y% is the initial y-coordinate of the
upper-left corner of the group box being created relative to the
upper-left corner of the parent window's client area.
- 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.
- 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.
- 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%. See your Win32 SDK or PSDK Reference
help for more information about valid Window Styles.
- ExWinStyle% [OPTIONAL] The
default Extended Window Style for a BCX_GROUP control is 0. See
your Win32 SDK or PSDK Reference help for more information about
valid Extended Window Styles.
Return Value:
- hCtl, the return value, is a handle to the new group box
if the function succeeds. If the function fails, the return value
is NULL.
|
Result: If the group box was created, the return value is
the handle to 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
CONST 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, 400, 220)
hBTN = BCX_BUTTON("Click Me",hFRM,IDBTN,310,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 = ! bToggle
' note: we're only moving the group control...
MoveWindow(hCTL[0],10,IIF(bToggle,50,10),380,100,True)
END IF
END EVENTS