Controls

The standard set of UI control classes that ship with twinBASIC lives in the VB built-in package — see VB Package for the package landing page. The classes below are grouped by purpose; each entry links to the per-class reference.

Forms and host classes

These classes are containers rather than controls in the strict sense — they host other controls and back the form/control designer in the IDE.

  • Form – top-level window hosting controls, menus, and a drawing surface.
  • MDIForm – top-level MDI parent that hosts MDI-child Form instances inside a recessed client area.
  • UserControl – base class for designing a reusable ActiveX control in twinBASIC.
  • PropertyPage – container backing a single tab of a COM property-page dialog (the (Custom) popup on an ActiveX control’s property browser).
  • Report – top-level window specialised for banded report layout, print preview, and printing.

Buttons and toggles

  • CommandButton – push-button used to trigger an action.
  • CheckBox – two- or three-state check box with an optional text caption.
  • CheckMark – windowless check glyph that scales to fill its rectangle; no caption, no focus.
  • OptionButton – radio-button; option buttons sharing a container form a mutually-exclusive group.

Text and value input

  • TextBox – single-line or multi-line edit control, with optional password masking and digit-only input.
  • ComboBox – edit field combined with a drop-down list of items.
  • ListBox – vertically-scrolling list of items, optionally multi-column and multi-select.
  • HScrollBar – stand-alone horizontal scroll bar.
  • VScrollBar – stand-alone vertical scroll bar.

File-system browsing

These three controls are normally connected together to build a complete file picker.

  • DriveListBox – drop-down list of the drives the operating system reports.
  • DirListBox – directory-tree picker for a single path.
  • FileListBox – file list for a single directory, filtered by wildcard and file-attribute toggles.

Containers

  • Frame – captioned container that groups related controls and scopes OptionButton groups.
  • MultiFrame – layout container that arranges a set of Frame controls in a horizontal or vertical strip.
  • PictureBox – Win32 native control combining picture display, a drawing surface, and a child-control container.

Display-only

  • Label – windowless lightweight read-only text display, used for captions, status text, and keyboard mnemonics.
  • Image – windowless lightweight picture display; the small, efficient alternative to PictureBox.
  • Line – windowless single straight line between two endpoints.
  • Shape – windowless geometric primitive (rectangle, oval, circle, star, arrow, …) with configurable border, fill, and rotation.
  • QRCode – windowless QR-code renderer populated from a text or byte-array payload.
  • Menu – item in a Win32 native menu — top-level entry on a Form’s or MDIForm’s menu bar, a drop-down entry, or a separator.

Data and external content

  • Data – Win32 native control that opens a DAO recordset and exposes record-navigation buttons for bound controls.
  • OLE – OLE container hosting a linked or embedded OLE Automation object (Word document, Excel sheet, …).
  • Timer – non-visual control that raises a periodic event at a programmable interval.

Controls in other packages

The VB package is not the whole story, and a control you remember from VB6 may live elsewhere:

Both of the first two ship with the IDE but are referenced on demand — add them from Project → References before the controls appear in the toolbox. See Built-In Packages.

Controls in contributed packages

Contributed packages on the package server replace VB6 controls that no package above has. These are by Krool:

  • VBFLXGRD18 holds the VBFlexGrid control, a replacement for the Microsoft FlexGrid control of VB6 (MSFLXGRD.OCX).
  • VBCCR18 replaces the Microsoft common controls of VB6. It has controls that WinNativeCommonCtls lacks, among them CoolBar, ImageCombo, RichTextBox, StatusBar, TabStrip and ToolBar. The Standard EXE (+VBCCR) template of the New Project dialog makes a project that references it already.
  • VBComDlg holds the CommonDialog class, whose members are modelled on those of the VB6 CommonDialog control (COMDLG32.OCX).

Importing a package from TWINSERV describes how to add one to a project.

VB6 controls in twinBASIC

This section lists the controls of VB6 and where each is in twinBASIC.

Intrinsic controls

Every control of the VB6 toolbox that needs no component — PictureBox to OLE — has a class of the same name in the VB package, listed above. Two things differ from VB6:

  • The OLE control is a stub. A form that holds one loads and lays it out, but the control cannot create, link or activate an OLE object.
  • The DDE members (LinkMode, LinkTopic, LinkExecute and the others) and RightToLeft are not implemented on the controls that have them.

Each class page marks the members that are not implemented. The twinBASIC roadmap plans the remaining ones.

ActiveX controls

VB6 also ships controls as ActiveX libraries, which a project adds as components. The table lists each library with its controls and what replaces them. A replacement works in 32-bit and 64-bit builds and needs no file registered.

VB6 library Controls In twinBASIC
MSCOMCTL.OCX ImageList, ListView, ProgressBar, Slider, TreeView WinNativeCommonCtls
MSCOMCTL.OCX ImageCombo, StatusBar, TabStrip, Toolbar VBCCR18
MSCOMCT2.OCX DTPicker, MonthView, UpDown WinNativeCommonCtls
MSCOMCT2.OCX Animation VBCCR18
MSCOMCT2.OCX FlatScrollBar no replacement
COMCT332.OCX CoolBar VBCCR18
COMDLG32.OCX CommonDialog VBComDlg
RICHTX32.OCX RichTextBox VBCCR18
MSFLXGRD.OCX MSFlexGrid VBFLXGRD18
MSHFLXGD.OCX MSHFlexGrid no replacement
SYSINFO.OCX SysInfo VBCCR18
TABCTL32.OCX SSTab no replacement; see NewTabCtl, an experimental package
MSWINSCK.OCX Winsock planned
MSMAPI32.OCX MAPISession, MAPIMessages planned
MSADODC.OCX Adodc planned
MSDATGRD.OCX DataGrid planned
MSCOMM32.OCX MSComm planned
MSINET.OCX Inet no replacement
MSMASK32.OCX MaskEdBox no replacement
MCI32.OCX MMControl no replacement
PICCLP32.OCX PictureClip no replacement
MSCHRT20.OCX MSChart no replacement
MSDATLST.OCX DataList, DataCombo no replacement
MSDATREP.OCX DataRepeater no replacement
DBGRID32.OCX DBGrid no replacement
DBLIST32.OCX DBList, DBCombo no replacement
MSRDC20.OCX RemoteData no replacement

COMCTL32.OCX and COMCT232.OCX hold the earlier versions of the controls of MSCOMCTL.OCX and MSCOMCT2.OCX, and the same packages replace them.

Planned means that the roadmap names the control among the VB6 controls that twinBASIC will implement itself. The roadmap states that all the remaining ones will follow.

A control with no replacement, and any other control of the table, can be used as VB6 uses it: the VB6 library itself, added to the project. The VB6 libraries are 32-bit, so this works in a 32-bit build only. See Can I use VB6’s own ActiveX controls? in the FAQ.

Windows Forms counterparts

For a reader who knows .NET, the table names the Windows Forms class nearest to each control. The classes are in the System.Windows.Forms namespace, and each link opens Microsoft’s reference for the class. A counterpart is the nearest class and not an equivalent: its members and its behaviour differ.

The other controls of this page have no close counterpart among the Windows Forms classes.