BCX_CHECKBOX function

Purpose: BCX_CHECKBOX creates a checkbox, whose check state automatically toggles between checked and cleared each time the user selects the check box.


 Syntax:

 hCtl = BCX_CHECKBOX(Text$, _
                 hWndParent, _
                    hCtlID%, _
                      Xpos%, _
                      Ypos%, _
                     Width%, _
                    Height%  _
                [,WinStyle%] _
              [,ExWinStyle%])

 Parameters:

  • hCtl The return value is a handle to the new checkbox if the function succeeds. If the function fails, the return value is NULL.
  • Text$ Label for the checkbox.
  • hWndParent Handle to the parent window of the checkbox being created.
  • hCtlID% Specifies the identifier of the checkbox being created. The identifier is an integer value used by the checkbox 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 checkbox being created. X% is the x-coordinate of the upper-left corner of the checkbox being created relative to the upper-left corner of the parent window's client area.
  • Ypos% Specifies the initial vertical position of the checkbox being created. Y% is the initial y-coordinate of the upper-left corner of the checkbox 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 checkbox being created. If the width is equal to zero, the checkbox will be resized automatically to accommodate the width of the caption.
  • Height% Specifies the height, in device units or, if the PIXELS optional parameter was specified in the GUI statement, in pixels, of the checkbox being created.
  • WinStyle% [OPTIONAL] If the WinStyle% parameter is used, the default Window Style for a BCX_CHECKBOX control, WS_CHILD | WS_VISIBLE | BS_AUTOCHECKBOX | WS_TABSTOP, 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_CHECKBOX control is 0. See your Win32 SDK or PSDK Reference help for more information about valid Extended Window Styles.

Remarks: The default window Style for a BCX_CHECKBOX control also can be changed by using the MODSTYLE function.

For an example of the BCX_CHECKBOX function see Demo.bas in the BCX\Gui_Demo\EZ_Gui folder.