Caption
| Type | Default | Access |
|---|---|---|
| String | "" | Designer and BASIC |
Window title shown in the title bar. A form saved without Caption shows McBasic™.
Configure the window deliberately, then preserve the exact signatures of its event handlers.
Select the Form itself in the Designer to edit window settings. Defaults below come from the application contract; a template may save different initial values. Use the access label before assigning a property in BASIC.
Caption| Type | Default | Access |
|---|---|---|
| String | "" | Designer and BASIC |
Window title shown in the title bar. A form saved without Caption shows McBasic™.
Font| Type | Default | Access |
|---|---|---|
| String | "" | Designer and BASIC |
Default font of the form's controls: Family|Size or Family|Size|Regular/Bold|Normal/Italic, size 6–96 DIP. Empty uses the theme font; System uses the theme family.
ForeColor| Type | Default | Access |
|---|---|---|
| String | "" | Designer and BASIC |
Default text color of the form's controls as #RRGGBB. Empty uses the theme color.
BackColor| Type | Default | Access |
|---|---|---|
| String | "" | Designer and BASIC |
Form background color as #RRGGBB. Empty uses the standard light gray #F0F0F0.
Width| Type | Default | Access |
|---|---|---|
| Double | 520 | Designer and BASIC |
Width of the form's content area in device-independent points; greater than 0 and within MinWidth to MaxWidth.
Height| Type | Default | Access |
|---|---|---|
| Double | 260 | Designer and BASIC |
Height of the form's content area in device-independent points; greater than 0 and within MinHeight to MaxHeight.
MinWidth| Type | Default | Access |
|---|---|---|
| Double | 200 | Designer and BASIC |
Smallest width the user can resize the form to, in DIP; greater than 0.
MinHeight| Type | Default | Access |
|---|---|---|
| Double | 120 | Designer and BASIC |
Smallest height the user can resize the form to, in DIP; greater than 0.
MaxWidth| Type | Default | Access |
|---|---|---|
| Double | 100000 | Designer and BASIC |
Largest width the user can resize the form to, in DIP.
MaxHeight| Type | Default | Access |
|---|---|---|
| Double | 100000 | Designer and BASIC |
Largest height the user can resize the form to, in DIP.
MDIForm| Type | Default | Access |
|---|---|---|
| Boolean | False | Designer only |
Host child Form instances inside this window. A DesktopApp may declare one MDIForm. Cannot be combined with MDIChild. Set in the designer only.
MDIChild| Type | Default | Access |
|---|---|---|
| Boolean | False | Designer only |
Show instances inside the project's MDIForm instead of as separate windows. Check requires an MDIForm. Set in the designer only.
MDIClientTop| Type | Default | Access |
|---|---|---|
| Double | 0 | Designer only |
Top offset in DIP of the MDI child area below the child selector; reserve space for the main Form controls. 0 uses the full workspace. Used only by an MDIForm; set in the designer only.
KeyPreview| Type | Default | Access |
|---|---|---|
| Boolean | False | Designer and BASIC |
Deliver KeyDown, KeyPress and KeyUp to the Form before the focused control. Setting Handled stops delivery to the control.
StartUpPosition| Type | Default | Access |
|---|---|---|
| String | "CenterOwner" | Designer; read-only in BASIC |
Where the window first appears. Manual uses Left and Top; CenterScreen centres it on the screen; CenterOwner centres it over the form that shows it (a dialog's owner, or the active window) and on the screen when there is none. An MDI child: Manual uses Left and Top in the MDI area, CenterScreen centres it there, CenterOwner cascades. Read-only in code.
Left| Type | Default | Access |
|---|---|---|
| Double | 0 | Designer and BASIC |
Distance in DIP from the left edge of the main screen's visible area to the window frame, used when StartUpPosition is Manual. The designer does not move the form. Setting it in code moves the window; a window is kept with 40 DIP of its title bar on screen. Positions are measured from, and kept on, the main screen, so setting Left or Top in code moves a window on another display back to the main screen.
Top| Type | Default | Access |
|---|---|---|
| Double | 0 | Designer and BASIC |
Distance in DIP from the top of the main screen's visible area (below the menu bar) to the window frame, used when StartUpPosition is Manual. The designer does not move the form. Setting it in code moves the window. Positions are measured from, and kept on, the main screen, so setting Left or Top in code moves a window on another display back to the main screen.
BorderStyle| Type | Default | Access |
|---|---|---|
| String | "Sizable" | Designer and BASIC |
Window frame. Sizable: resizable. Fixed: not resizable, title bar shown; zoom is unavailable. Dialog: not resizable, no minimize or zoom. None: no title bar; ControlBox, MinButton and MaxButton are ignored, and the window closes only from code (Unload Me) or when the app quits (Cmd-Q), so give it its own close button. ToolWindow: on macOS the same as Fixed with close only (no utility panel API). Can be changed in code.
ControlBox| Type | Default | Access |
|---|---|---|
| Boolean | True | Designer and BASIC |
Enables the close button. False also refuses every other user close; Unload Me, App.Quit and Cmd-Q still close the form, so give it its own close button. Ignored when BorderStyle is None.
MinButton| Type | Default | Access |
|---|---|---|
| Boolean | True | Designer and BASIC |
Enables the minimize button (to the Dock) for a Sizable or Fixed form.
MaxButton| Type | Default | Access |
|---|---|---|
| Boolean | True | Designer and BASIC |
Enables the green zoom button for a Sizable form. False greys out only that button: the window keeps macOS full-screen support, and McBasic™ apps have no Enter Full Screen menu item.
WindowState| Type | Default | Access |
|---|---|---|
| String | "Normal" | Designer and BASIC |
Normal, Minimized (in the Dock) or Maximized (zoomed; full screen also reads Maximized). Maximized needs BorderStyle Sizable and MaxButton; Minimized needs Sizable or Fixed and MinButton. Reflects the user's changes; assignable in code. Use vbNormal, vbMinimized, vbMaximized.
TopMost| Type | Default | Access |
|---|---|---|
| Boolean | False | Designer and BASIC |
Keeps the window above ordinary windows (floating level). Ignored for an MDI child.
Opacity| Type | Default | Access |
|---|---|---|
| Double | 1 | Designer and BASIC |
Window opacity from 0 (transparent) to 1 (opaque). An MDI child applies it to its surface in the MDI area.
Enabled| Type | Default | Access |
|---|---|---|
| Boolean | True | Designer and BASIC |
Whether the form's controls accept input. False disables every control; the window can still be moved and closed. A BorderStyle None form has no title bar, so while it is disabled only Cmd-Q or code closes it.
Visible| Type | Default | Access |
|---|---|---|
| Boolean | True | Runtime only |
Run time only: assigning True shows a hidden form as Show does, and False hides it (Hide). True on a form that is already shown does nothing; unlike Show, it does not bring the form to the front. The first form of the app is always shown.
Tag| Type | Default | Access |
|---|---|---|
| String in Designer; Variant in BASIC | "" | Designer and BASIC |
Application-defined value; text in the designer (at most 4096 UTF-16 units), any value in code (Variant). McBasic™ does not interpret it.
Cursor| Type | Default | Access |
|---|---|---|
| String | "Default" | Designer and BASIC |
Pointer shown over the form where no control sets its own: Default, Arrow, Hand, IBeam, Cross, Wait, Help, SizeAll, SizeNS, SizeWE, SizeNWSE, SizeNESW or NotAllowed.
AccessibleName| Type | Default | Access |
|---|---|---|
| String | "" | Designer and BASIC |
Window name announced by assistive technology; empty uses the Caption. At most 256 UTF-16 units.
Picture| Type | Default | Access |
|---|---|---|
| String | "" | Designer and BASIC |
Name of a declared project image resource painted behind the controls, over BackColor. Empty shows only BackColor. Assigning an undeclared or unreadable image in code raises error 481 (Invalid picture). The designer does not draw it.
PictureSizeMode| Type | Default | Access |
|---|---|---|
| String | "Normal" | Designer and BASIC |
How Picture fills the form: Normal (top-left, natural size), Stretch, Zoom (fit, keep proportions), Center (natural size, centred) or ZoomCrop (fill, keep proportions, crop).
In a copy of the first-app project, select frmMain. Set Caption to Greeting practice, Width to 640, Height to 360, MinWidth to 480, MinHeight to 260, BorderStyle to Sizable and StartUpPosition to CenterScreen. Keep ControlBox, MinButton and MaxButton enabled. Check and Run, resize the window, then stop it. The following complete Form event can be added for a runtime assignment exercise:
Private Sub Form_Load()
Me.Caption = "Greeting practice"
Me.Opacity = 1
Me.Tag = "practice-window"
End SubKeep the existing Click handlers unchanged. Confirm the title, resize limits and close action. Do not assign StartUpPosition in this handler. If experimenting with BorderStyle = None or ControlBox = False, first provide a tested button handler containing Unload Me; those settings change how the user can close the window.
The signatures below are contracts, not complete implementations. Add the body for your task and the matching End Sub. Preserve each parameter’s type and ByRef direction.
Occurs once after controls and event bindings are created, before the Form is loaded.
Private Sub Form_Initialize()No parameters.
Occurs once after initialization and before the Form is first shown.
Private Sub Form_Load()No parameters.
Occurs after the Form becomes visible; this lifecycle event may use Async Sub.
Private Sub Form_Shown()No parameters.
Occurs when this Form becomes the active ordinary window or active child of its MDI container.
Private Sub Form_Activate()No parameters.
Occurs when this Form ceases to be the active ordinary window or active child of its MDI container.
Private Sub Form_Deactivate()No parameters.
Occurs before a close attempt; set Cancel to True to keep the Form open and suppress Closed.
Private Sub Form_Closing(ByRef Cancel As Boolean)| Parameter | Type | Direction |
|---|---|---|
| Cancel | Boolean | ByRef |
Occurs once after an accepted close, before the Form resources become unavailable.
Private Sub Form_Closed()No parameters.
Occurs after the effective Form client size changes.
Private Sub Form_Resize()No parameters.
Occurs when a pointing-device button is pressed on the Form surface outside authored child controls.
Private Sub Form_MouseDown(ByVal Button As MouseButton, ByVal Shift As KeyModifiers, ByVal X As Double, ByVal Y As Double)| Parameter | Type | Direction |
|---|---|---|
| Button | MouseButton | ByVal |
| Shift | KeyModifiers | ByVal |
| X | Double | ByVal |
| Y | Double | ByVal |
Occurs when a pointing-device button is released on the Form surface outside authored child controls.
Private Sub Form_MouseUp(ByVal Button As MouseButton, ByVal Shift As KeyModifiers, ByVal X As Double, ByVal Y As Double)| Parameter | Type | Direction |
|---|---|---|
| Button | MouseButton | ByVal |
| Shift | KeyModifiers | ByVal |
| X | Double | ByVal |
| Y | Double | ByVal |
Occurs when the pointer moves over the logical McBasic™ control; Button contains the currently held buttons and X/Y are local DIP coordinates.
Private Sub Form_MouseMove(ByVal Button As MouseButtons, ByVal Shift As KeyModifiers, ByVal X As Double, ByVal Y As Double)| Parameter | Type | Direction |
|---|---|---|
| Button | MouseButtons | ByVal |
| Shift | KeyModifiers | ByVal |
| X | Double | ByVal |
| Y | Double | ByVal |
Occurs for normalized pointer-wheel input; Delta is portable, and X/Y are local DIP coordinates.
Private Sub Form_MouseWheel(ByVal Delta As Double, ByVal Shift As KeyModifiers, ByVal X As Double, ByVal Y As Double)| Parameter | Type | Direction |
|---|---|---|
| Delta | Double | ByVal |
| Shift | KeyModifiers | ByVal |
| X | Double | ByVal |
| Y | Double | ByVal |
Occurs while a control dragged inside the app (DragMode or the Drag method) moves over the Form surface outside other controls: State is 0 when it enters, 2 while it moves over and 1 when it leaves; Source is the dragged control and X, Y are Form client DIP coordinates.
Private Sub Form_DragOver(ByVal Source As Control, ByVal X As Single, ByVal Y As Single, ByVal State As Integer)| Parameter | Type | Direction |
|---|---|---|
| Source | Control | ByVal |
| X | Single | ByVal |
| Y | Single | ByVal |
| State | Integer | ByVal |
Occurs when a control dragged inside the app (DragMode or the Drag method) is released over the Form surface outside other controls; Source is the dragged control and X, Y are Form client DIP coordinates.
Private Sub Form_DragDrop(ByVal Source As Control, ByVal X As Single, ByVal Y As Single)| Parameter | Type | Direction |
|---|---|---|
| Source | Control | ByVal |
| X | Single | ByVal |
| Y | Single | ByVal |
Occurs before the focused control receives a physical key when KeyPreview is True; set Handled to suppress control delivery.
Private Sub Form_KeyDown(ByVal KeyCode As KeyCode, ByVal Shift As KeyModifiers, ByRef Handled As Boolean)| Parameter | Type | Direction |
|---|---|---|
| KeyCode | KeyCode | ByVal |
| Shift | KeyModifiers | ByVal |
| Handled | Boolean | ByRef |
Occurs for committed Unicode text before the focused control receives it when KeyPreview is True; set Handled to suppress control delivery.
Private Sub Form_KeyPress(ByVal Character As String, ByRef Handled As Boolean)| Parameter | Type | Direction |
|---|---|---|
| Character | String | ByVal |
| Handled | Boolean | ByRef |
Occurs before the focused control receives a physical key release when KeyPreview is True; set Handled to suppress control delivery.
Private Sub Form_KeyUp(ByVal KeyCode As KeyCode, ByVal Shift As KeyModifiers, ByRef Handled As Boolean)| Parameter | Type | Direction |
|---|---|---|
| KeyCode | KeyCode | ByVal |
| Shift | KeyModifiers | ByVal |
| Handled | Boolean | ByRef |
Occurs before closing; set Cancel to a nonzero value to keep the Form open.
Private Sub Form_QueryUnload(ByRef Cancel As Integer, ByVal UnloadMode As Integer)| Parameter | Type | Direction |
|---|---|---|
| Cancel | Integer | ByRef |
| UnloadMode | Integer | ByVal |
Occurs once after closing is accepted and before Form resources are released.
Private Sub Form_Unload()No parameters.
20f4bfed6b · Build manifestOriginal web explanation, reviewed against these repository sources. API tables and example files follow the implementation.
metadata/standard-components.v1.json