Label Control
The label control simply displays one or more lines of text. The text cannot be edited, selected, nor copied by user action.

Arguments
The Control Add statement is used to create all new controls. Here are the statement's arguments and any special significance to the label control.

Label transparency is not a built-in feature.

Label-Specific PowerBASIC Statements
Although PowerBASIC provides control-specific statements for some controls (Treeview, Imagelist, ...), there are no LABEL PowerBASIC statements.

Messages, Notifications, Styles, and ExtSstyles
There are four types of named constants in the following table. All are pulled from the MSDN web site.

The first column contains control-specific named constants and the second column contains generic window named constants (label controls are windows).

Also, if the PowerBASIC Help file has an entry on the value, it is highlighted in yellow. If the value was noted in PowerBASIC Help as a default value, it is also shown in bold text.

In the values for notifications, descriptions starting with -n and -c refer to events received through the %wm_notify and %wm_command messages. By default, PowerBASIC controls can receive both of these messages.

   

And here is a short description of many of the named constants corresponding to notifications, styles, and extstyle - particularly those discussed in the PowerBASIC Help topics.

    %ss_center             - horizontally center text. auto-wrap.
    %ss_centerimage        - center image. fill border with 0,0 pixel color
    %ss_endellipsis        - use ... to keep content within control
    %ss_etchedframe        - etched edge style (default)
    %ss_etchedhorz         - horizontal edges with etched edge style
    %ss_etchedvert         - vertical edges with etched edge style.
    %ss_left               - left align text
    %ss_noprefix           - prevent & interpretation
    %ss_notify             - allows %stn_clicked/%stn_dblclk messages
    %ss_nowordwrap         - left align text. expand tabs. no word wrap
    %ss_pathellipsis       - replace path portion of string with ...
    %ss_right              - right align text. auto-wrap.
    %ss_simple             - left align text. 
    %ss_sunken             - draw half-sunken border
    %ss_wordellipsis       - truncate text, add ... as needed
    %stn_clicked           -c mouse click
    %stn_dblclk            -c double slick
    %stn_disable           -c when control has been disabled
    %stn_enable            -c when control has been enabled
    %wm_ctlcolorstatic     -  about to be drawn
    %ws_ex_clientedge      - apply sunken edge border
    %ws_ex_left            - generic left-aligned properties
    %ws_ex_right           - generic right-aligned properties
    %ws_ex_staticedge      - apply 3D border
    %ws_ex_transparent     - draw controls/windows beneath control first
    %ws_group              - starts/ends group. use %ws_tabstop style.

Callback Function
A control can have its own callback function, or use the parent dialog callback function.

A control callback function should return TRUE to indicate it has processed the message. This prevents unnecessarily calling the dialog callback function, which will process the message if no control callback function is available, or if the control callback function returns FALSE.

By default, both %WM_COMMAND and %WM_NOTIFY messages are received. However, if the #MESSAGE COMMAND compiler directive is invoked, the %WM_NOTIFY messages will not be available.

In addition, %ss_notify must be included in style& to receive the %stn_clicked and %stn_dblclk messages.

Here's a sample label control callback function.

   CallBack Function cbLabel()
      Select Case CB.MSG
         Case %WM_COMMAND
            Select Case CB.CTLMSG
               Case %stn_clicked
               Case %stn_dblclk
               Case %stn_disable
               Case %stn_enable
         End Select
      End Select
   End Function

In each Case section, add the statements the application needs to respond to the event. Also, be sure to add "Function=1" as appropriate to indicate that the event was handled by the callback function.

CONTROL Statement Syntax
The following table lists the various Control statements (except the ADD statements). Most, but not all, can be used with the label control. A one-line description of the statement and then its syntax are presented.

If you have any suggestions or corrections, please let me know.