DVX BASIC Control Reference

This document describes every VB-style control available in DVX BASIC. Each control maps to an underlying DVX widget loaded dynamically via .wgt DXE files. Properties and methods are dispatched through interface descriptors registered by each widget.

Table of Contents

Common Properties, Events, and Methods

Every control in DVX BASIC inherits a set of common properties, events, and methods. These are handled by the form runtime before dispatching to widget-specific interface descriptors.

Common Properties

PropertyTypeR/WDescription
NameStringRThe control's name (e.g. "Command1"). Read-only at runtime.
LeftIntegerR/WX position in pixels relative to the parent container.
TopIntegerR/WY position in pixels relative to the parent container.
WidthIntegerR/WCurrent width in pixels. Setting this changes the minimum width constraint.
HeightIntegerR/WCurrent height in pixels. Setting this changes the minimum height constraint.
MinWidthIntegerR/WMinimum width for layout. Alias for Width in the setter.
MinHeightIntegerR/WMinimum height for layout. Alias for Height in the setter.
MaxWidthIntegerR/WMaximum width cap (0 = no limit, stretch to fill).
MaxHeightIntegerR/WMaximum height cap (0 = no limit, stretch to fill).
WeightIntegerR/WLayout weight. 0 = fixed size, >0 = share extra space proportionally.
VisibleBooleanR/WWhether the control is visible.
EnabledBooleanR/WWhether the control accepts user input.
BackColorLongR/WBackground color as a 32-bit ARGB value.
ForeColorLongR/WForeground (text) color as a 32-bit ARGB value.
TabIndexIntegerRAccepted for VB compatibility but ignored. DVX has no tab order.

Common Events

These events are wired on every control loaded from a .frm file. Controls created dynamically at runtime via code only receive Click, DblClick, Change, GotFocus, and LostFocus; the keyboard, mouse, and scroll events below require the control to be defined in the .frm file.

EventParametersDescription
Click(none)Fires when the control is clicked.
DblClick(none)Fires when the control is double-clicked.
Change(none)Fires when the control's value or text changes.
GotFocus(none)Fires when the control receives keyboard focus.
LostFocus(none)Fires when the control loses keyboard focus.
KeyPressKeyAscii As IntegerFires when a printable key is pressed. KeyAscii is the ASCII code.
KeyDownKeyCode As Integer, Shift As IntegerFires when any key is pressed down. KeyCode is the scan code; Shift indicates modifier keys.
KeyUpKeyCode As Integer, Shift As IntegerFires when a key is released.
MouseDownButton As Integer, X As Integer, Y As IntegerFires when a mouse button is pressed over the control.
MouseUpButton As Integer, X As Integer, Y As IntegerFires when a mouse button is released over the control.
MouseMoveButton As Integer, X As Integer, Y As IntegerFires when the mouse moves over the control.
ScrollDelta As IntegerFires when the control is scrolled (mouse wheel or scrollbar).

Common Methods

MethodParametersDescription
SetFocus(none)Gives keyboard focus to this control.
Refresh(none)Forces the control to repaint.

Form

VB Equivalent: Form    DVX Widget: Window + VBox/HBox root

The Form is the top-level container representing a DVX window. It is declared in the .frm file with Begin Form FormName. All controls are children of the form's content box, which uses either VBox (default) or HBox layout.

Form Properties

PropertyTypeDefaultDescription
NameString"Form1"The form's name, used for event dispatch and Load statement.
CaptionString(same as Name)Window title bar text.
WidthInteger400Window width in pixels. Setting this disables AutoSize.
HeightInteger300Window height in pixels. Setting this disables AutoSize.
LeftInteger0Initial X position. Used when Centered is False.
TopInteger0Initial Y position. Used when Centered is False.
LayoutString"VBox"Content box layout: "VBox" (vertical) or "HBox" (horizontal).
AutoSizeBooleanTrueWhen True, the window shrink-wraps to fit its content.
ResizableBooleanTrueWhether the user can resize the window at runtime.
CenteredBooleanTrueWhen True, the window is centered on screen. When False, Left/Top are used.

Form Events

EventParametersDescription
Load(none)Fires after the form and all controls are created. This is the default event.
Unload(none)Fires when the form is being closed or unloaded.
QueryUnloadCancel As IntegerFires before Unload. Set Cancel = 1 to abort the close.
Resize(none)Fires when the window is resized by the user.
Activate(none)Fires when the window gains focus.
Deactivate(none)Fires when the window loses focus.

Form Methods (called on the form object)

StatementDescription
Load FormNameLoad the form (creates the window and controls, fires Load event).
Unload FormNameUnload the form (fires Unload, destroys window).
FormName.ShowMake the form visible.
FormName.Show 1Show as modal dialog (blocks until closed).
FormName.HideHide the form without unloading it.

Example

Sub Form_Load ()
    Form1.Caption = "Hello World"
    Print "Form loaded!"
End Sub

Sub Form_QueryUnload (Cancel As Integer)
    If MsgBox("Really quit?", 4) <> 6 Then
        Cancel = 1
    End If
End Sub

Sub Form_Resize ()
    Print "Window resized"
End Sub

CommandButton

VB Equivalent: CommandButton    DVX Widget: button | Name Prefix: Command

A push button that triggers an action when clicked. Created with wgtButton(parent, text).

Type-Specific Properties

PropertyTypeDescription
CaptionStringThe text displayed on the button. Use & for accelerator keys (e.g. "&OK").

No additional type-specific properties beyond common properties and Caption.

Default Event: Click

Example

Begin Form Form1
    Caption = "Button Demo"
    Begin CommandButton Command1
        Caption = "&Click Me!"
    End
End

Sub Command1_Click ()
    MsgBox "Button was clicked!"
End Sub

Label

VB Equivalent: Label    DVX Widget: label

A static text label. Supports left, center, and right alignment.

Type-Specific Properties

PropertyTypeDescription
CaptionStringThe text displayed by the label.
AlignmentEnumText alignment: Left (default), Center, or Right.

Default Event: Click

Example

Begin Label Label1
    Caption   = "Hello, World!"
    Alignment = "Center"
End

TextBox

VB Equivalent: TextBox    DVX Widget: textbox (single-line text input, max 256 chars)

A single-line text input field. Supports data binding via DataSource and DataField properties.

Type-Specific Properties

PropertyTypeDescription
TextStringThe text content of the input field.
DataSourceStringName of a Data control for data binding.
DataFieldStringColumn name for data binding.

Default Event: Change

Example

Begin TextBox Text1
    Text = "Enter text here"
End

Sub Text1_Change ()
    Label1.Caption = "You typed: " & Text1.Text
End Sub

TextArea

VB Equivalent: TextArea (DVX extension)    DVX Widget: textarea (multi-line text input, max 4096 chars)

A multi-line text editing area. This is a DVX extension with no direct VB3 equivalent (VB uses a TextBox with MultiLine=True). Supports syntax colorization, line numbers, auto-indent, and find/replace via the C API.

Type-Specific Properties

PropertyTypeDescription
TextStringThe full text content.

Default Event: Change

CheckBox

VB Equivalent: CheckBox    DVX Widget: checkbox

A toggle control with a label. Checked state is exposed as a Boolean.

Type-Specific Properties

PropertyTypeDescription
CaptionStringThe text displayed next to the checkbox.
ValueBooleanTrue if checked, False if unchecked.

Default Event: Click

Example

Begin CheckBox Check1
    Caption = "Enable feature"
End

Sub Check1_Click ()
    If Check1.Value Then
        Label1.Caption = "Feature ON"
    Else
        Label1.Caption = "Feature OFF"
    End If
End Sub

OptionButton

VB Equivalent: OptionButton    DVX Widget: radio (radio group + radio button) | Name Prefix: Option

A radio button for mutually exclusive choices. DVX uses a radio group container; individual OptionButtons are children of the group. The Value property returns the button's index within its group.

Type-Specific Properties

PropertyTypeDescription
CaptionStringThe text displayed next to the radio button.
ValueIntegerThe index of this radio button within its group (read-only).

Type-Specific Methods

MethodParametersDescription
SetSelectedIndex As IntegerSelect the radio button at the given index within the group.

Default Event: Click

Frame

VB Equivalent: Frame    DVX Widget: frame (titled VBox container)

A container with a titled border. Child controls are placed inside the frame using VBox layout. In the .frm file, nest Begin/End blocks inside the Frame block.

Type-Specific Properties

PropertyTypeDescription
CaptionStringThe title displayed in the frame border.

Container: Yes

Default Event: Click

Example

Begin Frame Frame1
    Caption = "Options"
    Begin CheckBox Check1
        Caption = "Option A"
    End
    Begin CheckBox Check2
        Caption = "Option B"
    End
End

VBox

DVX Extension    DVX Widget: vbox (vertical layout container)

A container that arranges its children vertically, top to bottom. No title or border. Use Weight on children to distribute extra space.

Container: Yes

Default Event: Click

No type-specific properties.

HBox

DVX Extension    DVX Widget: hbox (horizontal layout container)

A container that arranges its children horizontally, left to right. Use Weight on children to distribute extra space.

Container: Yes

Default Event: Click

No type-specific properties.

ListBox

VB Equivalent: ListBox    DVX Widget: listbox

A scrollable list of selectable items. Items are managed via methods (AddItem, RemoveItem, Clear). Supports single and multi-select modes.

Type-Specific Properties

PropertyTypeDescription
ListIndexIntegerIndex of the currently selected item (-1 = no selection).
ListCountIntegerNumber of items in the list (read-only).

Type-Specific Methods

MethodParametersDescription
AddItemText As StringAdd an item to the end of the list.
RemoveItemIndex As IntegerRemove the item at the given index.
Clear(none)Remove all items from the list.
ListIndex As IntegerReturn the text of the item at the given index.
SelectAll(none)Select all items (multi-select mode).
ClearSelection(none)Deselect all items.
SetMultiSelectMulti As BooleanEnable or disable multi-select mode.
SetReorderableReorderable As BooleanEnable or disable drag-to-reorder.
IsItemSelectedIndex As IntegerReturns True if the item at Index is selected.
SetItemSelectedIndex As Integer, Selected As BooleanSelect or deselect a specific item.

Default Event: Click

Example

Sub Form_Load ()
    List1.AddItem "Apple"
    List1.AddItem "Banana"
    List1.AddItem "Cherry"
End Sub

Sub List1_Click ()
    Dim idx As Integer
    idx = List1.ListIndex
    If idx >= 0 Then
        Label1.Caption = "Selected: " & List1.List(idx)
    End If
End Sub

ComboBox

VB Equivalent: ComboBox    DVX Widget: combobox (editable text field + drop-down list, max 256 chars)

A combination of a text input and a drop-down list. The user can type text or select from the list. Supports the same AddItem/RemoveItem/Clear/List methods as ListBox.

Type-Specific Properties

PropertyTypeDescription
TextStringThe text in the editable field.
ListIndexIntegerIndex of the currently selected list item (-1 = none).
ListCountIntegerNumber of items in the drop-down list (read-only).

Type-Specific Methods

Same as ListBox: AddItem, RemoveItem, Clear, List.

Default Event: Click

DVX Extension    DVX Widget: dropdown (non-editable drop-down list)

A read-only drop-down list. Unlike ComboBox, the user cannot type free text; they can only select from the provided items. Supports AddItem/RemoveItem/Clear/List.

Type-Specific Properties

PropertyTypeDescription
ListIndexIntegerIndex of the currently selected item.
ListCountIntegerNumber of items (read-only).

Type-Specific Methods

Same as ListBox: AddItem, RemoveItem, Clear, List.

Default Event: Click

HScrollBar

VB Equivalent: HScrollBar    DVX Widget: slider | Name Prefix: HScroll

A horizontal slider/scrollbar control. The value ranges between a minimum and maximum set at creation time (default 0 to 100).

Type-Specific Properties

PropertyTypeDescription
ValueIntegerThe current slider position (clamped to min/max range).

Default Event: Change

Example

Begin HScrollBar HScroll1
    MinWidth = 200
End

Sub HScroll1_Change ()
    Label1.Caption = "Value: " & Str$(HScroll1.Value)
End Sub

SpinButton

DVX Extension    DVX Widget: spinner | Name Prefix: Spin

A numeric input with up/down buttons. Supports integer mode (default) and real-number mode with configurable decimal places.

Type-Specific Properties

PropertyTypeDescription
ValueIntegerCurrent integer value (in integer mode).
RealModeBooleanTrue to use floating-point mode; False for integer mode.
DecimalsIntegerNumber of decimal places shown in real mode.

Type-Specific Methods

MethodParametersDescription
SetRangeMin As Integer, Max As IntegerSet the allowed value range.
SetStepStep As IntegerSet the increment per button click.

Default Event: Change

Timer

VB Equivalent: Timer    DVX Widget: timer (non-visual)

A non-visual control that fires its event at a regular interval. The Timer widget is invisible at runtime -- it has no on-screen representation.

Type-Specific Properties

PropertyTypeDescription
EnabledBooleanTrue to start the timer, False to stop it.
IntervalIntegerTimer interval in milliseconds (write-only from BASIC).

Type-Specific Methods

MethodParametersDescription
Start(none)Start the timer.
Stop(none)Stop the timer.

Type-Specific Events

EventParametersDescription
Timer(none)Fires each time the interval elapses. This is the default event.
The Timer control fires the Timer event instead of Change. The onChange callback on the underlying widget is remapped automatically.

Example

Begin Timer Timer1
    Interval = 1000
    Enabled  = True
End

Dim counter As Integer

Sub Timer1_Timer ()
    counter = counter + 1
    Label1.Caption = "Ticks: " & Str$(counter)
End Sub

PictureBox

VB Equivalent: PictureBox    DVX Widget: canvas | Name Prefix: Picture

A drawing surface (canvas). Supports drawing lines, rectangles, circles, text, and individual pixels. Can save and load BMP images. The default canvas size is 64x64 pixels.

Type-Specific Methods

MethodParametersDescription
ClearColor As IntegerFill the entire canvas with the specified color.

Additional drawing methods (DrawLine, DrawRect, FillRect, FillCircle, SetPixel, GetPixel, DrawText, Save, Load) are available through the C API but not currently exposed through BASIC interface descriptors.

Default Event: Click

Image

VB Equivalent: Image    DVX Widget: image

A static image display control. Loads BMP images from file. Cannot be placed via the designer toolbox (requires pixel data at creation time); typically created in code or loaded via the Picture property.

Type-Specific Properties

PropertyTypeDescription
PictureStringPath to a BMP file to load (write-only).
ImageWidthIntegerWidth of the loaded image in pixels (read-only).
ImageHeightIntegerHeight of the loaded image in pixels (read-only).

Default Event: Click

ImageButton

DVX Extension    DVX Widget: imagebutton

A button that displays an image instead of text. Like Image, it requires pixel data at creation time and is typically loaded via the Picture property.

Type-Specific Properties

PropertyTypeDescription
PictureStringPath to a BMP file to load (write-only).
ImageWidthIntegerWidth of the loaded image in pixels (read-only).
ImageHeightIntegerHeight of the loaded image in pixels (read-only).

Default Event: Click

ProgressBar

VB Equivalent: ProgressBar    DVX Widget: progressbar

A horizontal progress indicator bar.

Type-Specific Properties

PropertyTypeDescription
ValueIntegerCurrent progress value (0-100).

No type-specific events or methods. No default event.

ListView

VB Equivalent: ListView    DVX Widget: listview

A multi-column list with column headers. Supports sorting, multi-select, and drag-to-reorder. Columns are configured via the C API (SetColumns, SetData).

Type-Specific Properties

PropertyTypeDescription
ListIndexIntegerIndex of the currently selected row (-1 = none).

Type-Specific Methods

MethodParametersDescription
SelectAll(none)Select all rows.
ClearSelection(none)Deselect all rows.
SetMultiSelectMulti As BooleanEnable or disable multi-select.
SetReorderableReorderable As BooleanEnable or disable row reordering.
IsItemSelectedIndex As IntegerReturns True if the row at Index is selected.
SetItemSelectedIndex As Integer, Selected As BooleanSelect or deselect a specific row.

Default Event: Click

TreeView

VB Equivalent: TreeView    DVX Widget: treeview

A hierarchical tree of expandable/collapsible nodes. Nodes are created via the C API (wgtTreeItem). Supports multi-select and drag-to-reorder.

Type-Specific Methods

MethodParametersDescription
SetMultiSelectMulti As BooleanEnable or disable multi-select mode.
SetReorderableReorderable As BooleanEnable or disable node reordering.

Default Event: Click

TabStrip

VB Equivalent: TabStrip    DVX Widget: tabcontrol

A tabbed container. Each tab page is a separate container that holds child controls. Switching tabs shows one page and hides others.

Type-Specific Properties

PropertyTypeDescription
TabIndexIntegerIndex of the active tab (0-based). Note: this property name collides with the common VB-compatibility TabIndex property, which shadows it at runtime. Use the SetActive method instead to switch tabs.

Type-Specific Methods

MethodParametersDescription
SetActiveIndex As IntegerSwitch to the tab at the given index. This is the recommended way to change tabs at runtime (the TabIndex property is shadowed by the common property handler).

Container: Yes

Default Event: Click

Splitter

DVX Extension    DVX Widget: splitter

A resizable split pane. Holds exactly two child widgets separated by a draggable divider. Default orientation is vertical (top/bottom split).

Type-Specific Properties

PropertyTypeDescription
PositionIntegerPosition of the divider in pixels from the top (or left).

Container: Yes

No default event.

ScrollPane

DVX Extension    DVX Widget: scrollpane | Name Prefix: Scroll

A scrollable container. Place child controls inside and the ScrollPane automatically provides scrollbars when the content exceeds the visible area.

Type-Specific Properties

PropertyTypeDescription
NoBorderBooleanWhen True, suppresses the border around the scroll pane.

Container: Yes

No default event.

WrapBox

DVX Extension    DVX Widget: wrapbox

A container that arranges children in a flowing layout, wrapping to the next row when the available width is exceeded. Similar to CSS flexbox with flex-wrap: wrap.

Type-Specific Properties

PropertyTypeDescription
AlignmentEnumHorizontal alignment of items: Left, Center, or Right.

Container: Yes

Default Event: Click

Line

VB Equivalent: Line    DVX Widget: separator

A visual separator line. The underlying widget supports both horizontal and vertical orientations. The default (via BASIC) is horizontal.

No type-specific properties, events, or methods.

Spacer

DVX Extension    DVX Widget: spacer

An invisible layout spacer. Takes up space in the layout without rendering anything. Useful for pushing controls apart. Give it a Weight to absorb extra space.

No type-specific properties, events, or methods.

Toolbar

VB Equivalent: Toolbar    DVX Widget: toolbar

A horizontal container styled as a toolbar, with compact padding and spacing. Place buttons, labels, or other controls inside.

Container: Yes

No type-specific properties, events, or methods.

StatusBar

VB Equivalent: StatusBar    DVX Widget: statusbar

A horizontal container styled as a status bar, typically placed at the bottom of a form. At the C API level it accepts child widgets, but it is not registered as a container in the form runtime, so child controls cannot be nested inside it in .frm files. Set its Caption property to display status text.

No type-specific properties, events, or methods.

Terminal

DVX Extension    DVX Widget: ansiterm (ANSI terminal emulator)

A VT100/ANSI terminal emulator widget. Supports ANSI escape sequences, scrollback buffer, and serial communication. Default size is 80 columns by 25 rows.

Type-Specific Properties

PropertyTypeDescription
ColsIntegerNumber of character columns (read-only).
RowsIntegerNumber of character rows (read-only).
ScrollbackIntegerNumber of scrollback lines (write-only).

Type-Specific Methods

MethodParametersDescription
Clear(none)Clear the terminal screen.
WriteText As StringWrite text (with ANSI escape processing) to the terminal.

No default event.

Data

VB Equivalent: Data    DVX Widget: data (database record navigator)

A data access control that connects to a SQLite database and provides record navigation. Other controls can bind to a Data control via their DataSource and DataField properties. See the Data Binding section for details.

Type-Specific Properties

PropertyTypeR/WDescription
DatabaseNameStringR/WPath to the SQLite database file.
RecordSourceStringR/WTable name or SQL SELECT query for the recordset.
KeyColumnStringR/WPrimary key column name (used for UPDATE/DELETE operations).
CaptionStringR/WText displayed on the navigator bar.
BOFBooleanRTrue if the current position is before the first record (read-only).
EOFBooleanRTrue if the current position is past the last record (read-only).
MasterSourceStringR/WName of a master Data control (for master-detail binding).
MasterFieldStringR/WColumn in the master recordset to filter by.
DetailFieldStringR/WColumn in this recordset that matches the master field.

Type-Specific Methods

MethodParametersDescription
MoveFirst(none)Navigate to the first record.
MoveLast(none)Navigate to the last record.
MoveNext(none)Navigate to the next record.
MovePrevious(none)Navigate to the previous record.
AddNew(none)Add a new blank record.
Delete(none)Delete the current record.
Refresh(none)Re-query the database and reload records.
Update(none)Write pending changes to the database.

Type-Specific Events

EventParametersDescription
Reposition(none)Fires after the current record changes (navigation). This is the default event.
ValidateCancel As IntegerFires before writing a record. Set Cancel = 1 to abort.

DBGrid

VB Equivalent: DBGrid    DVX Widget: dbgrid

A data-bound grid that displays records from a Data control in a tabular format. Columns are auto-generated from the query results. Bind it using the DataSource property.

Type-Specific Properties

PropertyTypeDescription
DataSourceStringName of the Data control that supplies records.
GridLinesBooleanShow or hide grid lines between cells.

Type-Specific Methods

MethodParametersDescription
Refresh(none)Reload and redraw the grid from the Data control.

Type-Specific Events

EventParametersDescription
Click(none)Fires when a cell is clicked.
DblClick(none)Fires when a cell is double-clicked. This is the default event.

Data Binding

DVX BASIC provides VB3-style data binding through three properties that can be set on most controls:

PropertySet OnDescription
DataSourceAny controlName of the Data control to bind to (e.g. "Data1").
DataFieldAny controlColumn name from the Data control's recordset to display.

How It Works

  1. Place a Data control on the form and set its DatabaseName and RecordSource properties.
  2. Place one or more display/edit controls (TextBox, Label, etc.) and set their DataSource to the Data control's name and DataField to a column name.
  3. When the form loads, the Data control auto-refreshes: it opens the database, runs the query, and navigates to the first record.
  4. Bound controls are updated automatically each time the Data control repositions (the Reposition event fires, and the runtime pushes the current record's field values into all bound controls).
  5. When a bound control loses focus (LostFocus), its current text is written back to the Data control's record cache, and Update is called automatically to persist changes.

Master-Detail Binding

For hierarchical data (e.g. orders and order items), use two Data controls:

  1. A master Data control bound to the parent table.
  2. A detail Data control with its MasterSource set to the master's name, MasterField set to the key column in the master, and DetailField set to the foreign key column in the detail table.

When the master record changes, the detail Data control automatically re-queries using the master's current value for filtering. All controls bound to the detail are refreshed.

DBGrid Binding

Set the DBGrid's DataSource to a Data control name. The grid auto-populates columns from the query results and refreshes whenever the Data control refreshes.

Example

VERSION DVX 1.00
Begin Form frmData
    Caption      = "Data Binding Example"
    AutoSize     = False
    Width        = 400
    Height       = 280
    Begin Data Data1
        DatabaseName = "myapp.db"
        RecordSource = "customers"
    End
    Begin Label lblName
        Caption = "Name:"
    End
    Begin TextBox txtName
        DataSource = "Data1"
        DataField  = "name"
    End
    Begin Label lblEmail
        Caption = "Email:"
    End
    Begin TextBox txtEmail
        DataSource = "Data1"
        DataField  = "email"
    End
End

Sub Data1_Reposition ()
    Print "Current record changed"
End Sub

Sub Data1_Validate (Cancel As Integer)
    If txtName.Text = "" Then
        MsgBox "Name cannot be empty!"
        Cancel = 1
    End If
End Sub

Menus are defined in the .frm file using Begin Menu blocks. Each menu item has a name, caption, and nesting level. Menu items fire Click events dispatched as MenuName_Click.

FRM Syntax

Begin Form Form1
    Caption = "Menu Demo"

    Begin Menu mnuFile
        Caption = "&File"
        Begin Menu mnuOpen
            Caption = "&Open"
        End
        Begin Menu mnuSave
            Caption = "&Save"
        End
        Begin Menu mnuSep1
            Caption = "-"
        End
        Begin Menu mnuExit
            Caption = "E&xit"
        End
    End

    Begin Menu mnuEdit
        Caption = "&Edit"
        Begin Menu mnuCopy
            Caption = "&Copy"
        End
        Begin Menu mnuPaste
            Caption = "&Paste"
        End
    End
End

Menu Item Properties

PropertyTypeDescription
CaptionStringThe text displayed. Use & for accelerator key. Set to "-" for a separator.
CheckedBooleanWhether the menu item shows a checkmark.
EnabledBooleanWhether the menu item is enabled (default True).

Nesting

Menu items are nested by placing Begin Menu blocks inside other Begin Menu blocks:

A level-0 menu that contains children becomes a top-level menu header. A non-level-0 menu that contains children becomes a submenu.

Event Dispatch

Each clickable menu item (not headers, not separators) receives a unique numeric ID at load time. When clicked, the form's onMenu handler maps the ID to the menu item's name and fires MenuName_Click.

Sub mnuOpen_Click ()
    MsgBox "Open was clicked"
End Sub

Sub mnuExit_Click ()
    Unload Form1
End Sub

Control Arrays

DVX BASIC supports VB-style control arrays. Multiple controls can share the same name, differentiated by an Index property. When an event fires on a control array element, the element's index is passed as the first parameter.

Defining Control Arrays in FRM

Begin CommandButton Command1
    Caption = "Button A"
    Index   = 0
End
Begin CommandButton Command1
    Caption = "Button B"
    Index   = 1
End
Begin CommandButton Command1
    Caption = "Button C"
    Index   = 2
End

Event Handler Convention

When a control has an Index property (>= 0), the event handler receives Index As Integer as the first parameter, before any event-specific parameters.

Sub Command1_Click (Index As Integer)
    Select Case Index
        Case 0
            MsgBox "Button A clicked"
        Case 1
            MsgBox "Button B clicked"
        Case 2
            MsgBox "Button C clicked"
    End Select
End Sub

Accessing Array Elements in Code

Use the indexed form ControlName(Index) to access a specific element:

Command1(0).Caption = "New Text"
Command1(1).Enabled = False
Control array elements share the same event handler Sub. The runtime prepends the Index argument automatically. If you define parameters on the Sub, Index comes first, followed by the event's own parameters (e.g. KeyPress would be Sub Ctrl1_KeyPress (Index As Integer, KeyAscii As Integer)).

FRM File Format

The .frm file is a text file that describes a form's layout, controls, menus, and code. It follows a format compatible with VB3 .frm files, with DVX-specific extensions.

Structure

VERSION DVX 1.00
Begin Form FormName
    form-level properties...

    Begin Menu mnuFile
        Caption = "&File"
        Begin Menu mnuOpen
            Caption = "&Open"
        End
    End

    Begin TypeName ControlName
        property = value
        ...
    End

    Begin Frame Frame1
        Caption = "Group"
        Begin TypeName ChildName
            ...
        End
    End
End

BASIC code follows...

Sub FormName_Load ()
    ...
End Sub

Rules

Common FRM Properties

PropertyApplies ToDescription
CaptionForm, controlsDisplay text or window title.
TextTextBox, ComboBoxInitial text content.
MinWidth / WidthControlsMinimum width. Both names are accepted.
MinHeight / HeightControlsMinimum height. Both names are accepted.
MaxWidthControlsMaximum width (0 = no cap).
MaxHeightControlsMaximum height (0 = no cap).
WeightControlsLayout weight for flexible sizing.
LeftForm, controlsX position (used by Form when Centered=False; informational for controls).
TopForm, controlsY position.
IndexControlsControl array index (-1 or absent = not in array).
VisibleControlsInitial visibility.
EnabledControlsInitial enabled state.
LayoutForm"VBox" or "HBox".
AutoSizeFormAuto-fit window to content.
ResizableFormAllow runtime resizing.
CenteredFormCenter window on screen.
DatabaseNameDataSQLite database file path.
RecordSourceDataTable name or SQL query.
DataSourceBound controlsName of the Data control.
DataFieldBound controlsColumn name in the recordset.

DVX BASIC Control Reference -- Generated from source code analysis of formrt.c, ideProperties.c, ideDesigner.c, and widget DXE interface descriptors.