BCX_LABEL function

Purpose:

BCX_LABEL creates a simple rectangle and left-aligns the text in the rectangle. The text is formatted before it is displayed. Words that extend past the end of a line are automatically wrapped to the beginning of the next left-aligned line. Words that are longer than the width of the control are truncated.

Syntax:

hCtl = BCX_LABEL(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 label if the function succeeds. If the function fails, the return value is NULL.

Parameters:

  • Data type: STRING
    Text Label text.
  • Data type: HWND
    hwndParent The handle of the parent window of the label being created.
  • Data type: INTEGER
    hCtlID Specifies the identifier of the label being created. The identifier is an integer value used by the label 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 label 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 label 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 label being created. If the width is equal to zero, the label will be resized automatically to accommodate the width of the caption.
  • 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 label being created.
  • Data type: INTEGER
    WinStyle [OPTIONAL] If the WinStyle parameter is used, the default Window Style for a BCX_LABEL control, WS_CHILD | SS_NOTIFY | SS_LEFT | WS_VISIBLE, is replaced with the value in WinStyle. For more information, visit the Microsoft Static Control Styles webpage and the Microsoft Window Styles webpage.
  • Data type: INTEGER
    ExWinStyle [OPTIONAL] The default Extended Window Style for a BCX_LABEL control is 0. For more information, visit the Microsoft Extended Window Styles webpage.

Remarks:

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

For an example of the BCX_LABEL function see Demo.bas.