Toolbox

The TOOLBOX pane lists the controls that you can draw on the active designer. You click a tool, and then click or drag on the form to draw the control. This page describes what the list holds, how to search it, and how to add ActiveX controls to it.

What the list holds

The compiler supplies the list, and the IDE replaces it in every open designer when the project’s references change. Each open designer has a Toolbox of its own, and the pane shows the one of the active designer. It is empty while a code tab is active.

A designer lists the controls that suit its kind of form:

  • A CustomControls form lists the controls of the CustomControls package, such as WaynesButton and WaynesGrid. See CustomControls.
  • Every other designer, that is a Windows form, an MDI form, a user control and a property page, lists the Windows controls.
  • A report lists only seven tools. See Designing reports.

The forms themselves are never tools, and neither is Menu. A menu is made in the menu editor.

The first group has no title bar. It starts with Pointer, the tool for selecting, and then lists the standard controls in a fixed order: PictureBox, Label, TextBox, Frame, CommandButton, CheckBox, OptionButton, ComboBox, ListBox, HScrollBar, VScrollBar, Timer, DriveListBox, DirListBox, FileListBox, Shape, Line, Image, CheckMark, QRCode, Data and OLE. Any further controls of the package follow in alphabetical order, such as MultiFrame. Every other package that supplies controls gets a group of its own with a title bar, which names the package in capitals. The package WinNativeCommonCtls shows as COMMON CONTROLS. Controls describes the controls.

Each tool is an icon. A tool whose control runs in a separate process shows a small label, 32-bit or 64-bit, and a tooltip says that the control is hosted by a separate 32-bit EXE process at run time.

By default the Toolbox shows icons only. The … button in the title bar opens a menu with one item, Show Control Names, which is ticked while the names are shown. Choosing it saves the IDE option IDE: Show toolbox icons only at once. See IDE Options.

The docked Toolbox of a Windows form with control names shown, scrolled to its end. The first group, without a title bar, ends with ListBox to MultiFrame; under it the COMMON CONTROLS group lists DTPicker, ImageList, ListView, MonthView, ProgressBar, Slider, TreeView and UpDown, and More components ends the list.The docked Toolbox of a Windows form with control names shown, scrolled to its end. The first group, without a title bar, ends with ListBox to MultiFrame; under it the COMMON CONTROLS group lists DTPicker, ImageList, ListView, MonthView, ProgressBar, Slider, TreeView and UpDown, and More components ends the list.

Use a tool

  • Click a tool to select it. The pointer over the designer becomes a cross. Then draw the control.
  • Double-click a tool to place the control at once, centred from left to right on the form.
  • With the Toolbox focused, Left and Up select the previous tool, and Right and Down the next.

The tool returns to Pointer after each control.

The magnifier in the title bar opens a search box under it. Typing a printable character with a tool focused opens it too, holding that character. The list narrows as you type. The text is a list of parts of names, separated by commas, and a tool matches when its name contains any of them, in either case. Command, Text leaves Pointer, TextBox, CommandButton and More components. Groups with no match are hidden. The first group stays.

Esc, the close button of the box, or an empty box ends the search and shows the whole list.

The Toolbox with its search box holding Command, Text, beside three tool icons, the pointer, a text box and a command button, and More components below them. The menu of the ... button is open at the right, holding Show Control Names.The Toolbox with its search box holding Command, Text, beside three tool icons, the pointer, a text box and a command button, and More components below them. The menu of the ... button is open at the right, holding Show Control Names.

Note

In twinBASIC BETA 1005, a floating Toolbox lists every tool when a report is open, 24 controls and More components, where the docked Toolbox lists seven. A tool that a report does not allow is refused when you use it, so nothing is lost. Dock the Toolbox, or choose only the seven tools that a report allows.

Add ActiveX controls and components

The Toolbox has no list of components to pick from and no way to remove a control. ActiveX controls reach it as COM references of the project:

  1. Choose More components… at the end of the Toolbox. It is not shown for a report.
  2. In the box, choose GoTo COM References. Project Settings opens on the Available COM References tab, filtered to the project.references setting.
  3. Add the reference to the type library that holds the control, as Project Settings describes.

A selected ActiveX control has an ActiveX Properties… item in its right-click menu.

The Toolbox button labelled More components, a grey plus sign beside the text inside a dashed outline.The Toolbox button labelled More components, a grey plus sign beside the text inside a dashed outline.

The box says Components list coming soon! and that, for now, you must add ordinary COM references to the appropriate ActiveX type library, after which the components appear in the form designer automatically. It has two buttons, GoTo COM References and OK, which closes it.

A twinBASIC information box reading Components list coming soon, explaining that for now ordinary COM references to the appropriate ActiveX type library must be added and the components will then appear in the form designer automatically, above a GoTo COM References button and an OK button.A twinBASIC information box reading Components list coming soon, explaining that for now ordinary COM references to the appropriate ActiveX type library must be added and the components will then appear in the form designer automatically, above a GoTo COM References button and an OK button.

Project Settings describes the references and the Available COM References tab. Package controls such as WebView2, CefBrowser and the Common Controls appear in groups named for their package, when the project refers to the package and the form is a Windows form. Packages describes how to add a package.

See Also