The label font/color can be changed but the bounding line and body color are not under programmatic control.
Control Add Frame, hDlg, id&, txt$, x, y, xx, yy, _ style&, extsytle& CALL callback
#Compile Exe Global hDlg As Dword Function PBMain() As Long Dialog New Pixels, 0, "Frame Test",300,300,200,200, _ %WS_SysMenu, 0 To hDlg Control Add Frame, hdlg, 100, "Frame Example", 20,20,150,90, %BS_Left Dialog Show Modal hDlg End Function
An additional example of a callback function is provided further down this page.
As you can see, there's really not much you can do with a button - change the font, change the justification of the text, and multi-line content is about it.
Arguments
The Control Add statement is used to create all new controls. Here are the
statement's arguments and any special significance to the frame control.
Frame transparency is not a built-in feature.
Usage Notes
Some of these comments refer to the ComboBox-specific statement in the
next section below.
The PowerBASIC frame is not a parent control (as it is in some implementations). If you want the appearance of child controls in the frame, draw the frame first and the "child" controls last.
Changing line color/thickness and frame body color are not supported by PowerBASIC.
Frame-Specific PowerBASIC Statements
Although PowerBASIC provides control-specific statements for some controls (Treeview,
Imagelist, ...), there are no FRAME 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 (frames are windows).
Since the PowerBASIC frame control is derived from the Windows button class, the first column contains MSDN button control constants.
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.
bcn_dropdown -n click on drop down arrow on control bcn_hotitemchange -n mouse enters/leaves client area bn_clicked -c mouse click bn_dblclk -c mouse doubleclick bn_disable -c (n/a - win3.0 only) bn_doubleclicked -n mouse doubleclick bn_hilite -c (n/a - win3.0 only) bn_killfocus -c focus is lost bn_paint -c control should be painted bn_pushed -c (n/a - win3.0 only) bn_setfocus -n focus is received bn_unhilite -c when highlight should be removed bn_unpushed -c (n/a - win3.0 only) bs_bottom - text at bottom bs_center - center text horizontally bs_default - heavy black border, ENTER selects, 1 per dialog bs_defpushbutton - same as bs_default bs_left - text on left side bs_multiline - wrap text bs_notify - allows bn_killfocus/bn_setfocus messages bs_pushlike - toggle between raised/sunken bs_right - text on right side bs_top - text at top bs_vcenter - center text vertically nm_customdraw -n custom draw operation wm_ctlcolorbtn - before drawing owner-drawn control ws_border - use thin line border ws_disabled - initially disabled (no user input) ws_ex_left - generic left-aligned properties ws_ex_right - generic right-aligned properties ws_ex_transparent - draw controls/windows beneath control first ws_group - starts/ends group. use ws_tabstop style. ws_tabstop - allows receipt of keyboard focus
Callback Function
A frame control does not send messages and does require/support
a 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 frame control. A one-line description of
the statement and then its syntax are presented.
CONTROL DISABLE disable
hDlg, id&
CONTROL ENABLE enable
hDlg, id&
CONTROL GET CHECK check state
hDlg, id& TO iResult1&
CONTROL GET CLIENT top/left location
hDlg, id& TO wide&, high&
CONTROL GET LOC top/left location
hDlg, id& TO x&, y&
CONTROL GET SIZE width/height
hDlg, id& TO width&, height&
CONTROL GET TEXT text
hDlg, id& TO txt$
CONTROL GET USER get user data
hDlg, id&, index& TO retvar&
CONTROL HANDLE window handle for control id
hDlg, id& TO hCtl&
CONTROL KILL remove control
hDlg, id&
CONTROL POST put message in queue (non-blocking)
hDlg, id&, Msg&, wParam&, lParam&
CONTROL REDRAW schedule redraw of control
hDlg, id&
CONTROL SEND send message to control, wait for processing
hDlg, id&, Msg&, wParam&, lParam& TO iResult2&
CONTROL SET CHECK set check for 3state or checkbox
hDlg, id&, checkstate&
CONTROL SET CLIENT change size to specific client area size
hDlg, id&, wide&, high&
CONTROL SET COLOR set fg/bg color
hDlg, id&, fgcolor&, bgcolor&
CONTROL SET FOCUS set focus
hDlg, id&
CONTROL SET FONT select font for a control
hDlg, id&, fonthandle&
CONTROL SET LOC relocate control within dialog
hDlg, id&, x&, y&
CONTROL SET OPTION set check state of option control
hDlg, id&, minid&, maxid&
CONTROL SET SIZE change control size
hDlg, id&, width&, height&
CONTROL SET TEXT change control text
hDlg, id&, text$
CONTROL SET USER set user data
hDlg, id&, index&, uservalue&
CONTROL SHOW STATE toggle visibility
hDlg, id&, showstate& TO iResult3&
If you have any suggestions or corrections, please let me know.