BCX_CONTROL function

Purpose:

BCX_CONTROL is for the simple creation of custom controls.

Syntax:

hCtl = BCX_CONTROL(ClassName AS STRING, _
                    hwndParent AS HWND, _
                     Caption AS STRING, _
                     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 control if the function succeeds. If the function fails, the return value is NULL.

Parameters:

  • Data type: STRING
    ClassName Specifies class of control to create. This can be any of the following (in bold print).
    • ListBox List boxes.
    • Button Push, radio, check buttons, group boxes.
    • Static Labels.
    • Edit Text edit boxes.
    • ComboBox Combo boxes, drop-down lists.
    • ScrollBar Scroll bars
    • #32768 USER menus
    • #32770 USER dialog boxes
    • #32771 Alt-tab window
    • msctls_statusbar32 Status bars
    • msctls_progress32 Progress bars
    • msctls_hotkey32 Hot key controls
    • msctls_trackbar32 Trackbars, sliders
    • msctls_updown32 Up-down or spin controls
    • SysAnimate32 Animation control
    • SysTabControl32 Tab control
    • SysHeader32 List view headers
    • SysListView32 List view controls
    • SysTreeView32 Tree view controls
    • SysDateTimePick32 Date and/or time picker
    • SysMonthCal32 Calendar control
    • SysIPAddress32 IP address controls
    • tooltips_class32 ToolTips
    • ToolbarWindow32 Toolbars
    • RICHEDIT Text fields
    • RichEdit20A Text fields
    • RichEdit20W Text fields
  • Data type: HWND
    hwndParent The handle of the parent window of the control being created.
  • Data type: STRING
    Caption Not used.
  • Data type: INTEGER
    hCtlID Specifies the identifier of the control being created. The identifier is an integer value used by the control being created to notify its parent about events. The identifier must be unique for each control created with the same parent window. As with all controls, if you don't need to interact with it, then you can set its hCtlID% to zero.
  • Data type: INTEGER
    Xpos Specifies the initial horizontal x-coordinate value of the upper-left corner location of the button 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 control being created relative to the upper-left corner of the parent window's client area.
  • 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 combobox being created.
  • 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 combobox being created.
  • Data type: INTEGER
    WinStyle [OPTIONAL] If the WinStyle parameter is used, the default Window Style for a BCX_CONTROL control, WS_CHILD | WS_VISIBLE | WS_TABSTOP | WS_CLIPCHILDREN | WS_CLIPSIBLINGS, is replaced with the value in WinStyle. For more information, visit the Microsoft Tree View Control Styles webpage and the Microsoft Window Styles webpage.
  • Data type: INTEGER
    ExWinStyle [OPTIONAL] The default Extended Window Style for a BCX_CONTROL control is WS_EX_CLIENTEDGE. For more information, visit the Microsoft Extended Window Styles webpage.

Remarks:

As with all controls, if you don't need to interact with it, then you can set its hCtlID% to zero. BCX_CONTROL translates to the WinAPI function CreateWindowEx.