# VBCCR18 Package
{: .no_toc }

**Author:** Krool. **Version:** 1.8.141.0. **On GitHub:** [Kr00l/VBCCR](https://github.com/Kr00l/VBCCR)

The **VBCCR18** contributed package provides controls that stand in place of the Microsoft common controls of VB6, Unicode versions of the VB6 intrinsic controls, and controls of Windows that VB6 never had.

The controls are Krool's *VB Common Controls Replacement* library, written in VB6 and published on GitHub as an ActiveX control library, `VBCCR18.OCX`; this package is the same code compiled by twinBASIC, so a project needs no OCX to be registered. Each control is a window of Windows itself, such as the list view or the rich edit control, so it draws and behaves as the same control does in any Windows program. Most members of the Microsoft controls keep their names and meanings. This section documents version 1.8.141.0, published under the MIT licence. The package describes itself as "VB Common Controls Replacement 1.8 Library (Experimental, 32-bit and 64-bit)".

```tb check_build check_run arch=win32,win64
ProgressBar1.Min = 0
ProgressBar1.Max = 200
ProgressBar1.Value = 50
TextBoxW1.Text = ChrW$(&H3A9) & "mega"      ' a Greek capital omega, kept as it is
Debug.Print ProgressBar1.Value; Len(TextBoxW1.Text); AscW(TextBoxW1.Text)
' Output:
'  50  5  937
```

* TOC
{:toc}

## Adding a control to a form

Add the package to the project as [Importing a package from TWINSERV](/Features/Packages/Importing-TWINSERV.md) describes. The **Standard EXE (+VBCCR)** template of the [New Project](/tB/IDE/Starting/New-Project.md) dialog makes a project that references it already. The controls are then in the [Toolbox](/tB/IDE/Forms/Toolbox.md): select one and draw it on the form. In code it is named as any other control on the form is, **ProgressBar1** for the first **ProgressBar**.

The controls are those of Windows, and Windows draws them in its current visual style only in a program that has the [visual styles manifest](/tB/IDE/Projects/Adding-Files.md#visual-styles-manifest) among its resources. The **Standard EXE (+VBCCR)** template adds it; in another project, add it before building. In a program built without it the controls are drawn in the classic style, and the two that Windows has only with visual styles, [**CommandLink**](/tB/Packages/Contributed/VBCCR18/CommandLink.md#a-program-without-visual-styles) and [**LinkLabel**](/tB/Packages/Contributed/VBCCR18/LinkLabel/index.md), make no window and show diagonal lines in their place.

Several controls have the name of a control of the [WinNativeCommonCtls](/tB/Packages/WinNativeCommonCtls/index.md) package: **DTPicker**, **ImageList**, **ListView**, **MonthView**, **ProgressBar**, **Slider**, **TreeView** and **UpDown**. In a project that references both packages, a declaration names the package as well: `Dim Bar As VBCCR18.ProgressBar`.

## Controls in place of the VB6 intrinsic controls

Each of these is the VB6 control of the same name without the `W`, with text in Unicode and the features Windows has added to the control since.

- [**CheckBoxW**](/tB/Packages/Contributed/VBCCR18/CheckBoxW.md) -- a check box
- [**ComboBoxW**](/tB/Packages/Contributed/VBCCR18/ComboBoxW.md) -- a text box with a drop-down list
- [**CommandButtonW**](/tB/Packages/Contributed/VBCCR18/CommandButtonW.md) -- a push button, also with a drop-down arrow
- [**FrameW**](/tB/Packages/Contributed/VBCCR18/FrameW.md) -- a captioned frame that holds other controls
- [**LabelW**](/tB/Packages/Contributed/VBCCR18/LabelW.md) -- text on the form, with no window of its own
- [**ListBoxW**](/tB/Packages/Contributed/VBCCR18/ListBoxW.md) -- a list of text items
- [**OptionButtonW**](/tB/Packages/Contributed/VBCCR18/OptionButtonW.md) -- an option button
- [**TextBoxW**](/tB/Packages/Contributed/VBCCR18/TextBoxW.md) -- a text box of one or several lines

## Controls in place of the Microsoft common controls

| Control | Shows | VB6 library |
|---|---|---|
| [**Animation**](/tB/Packages/Contributed/VBCCR18/Animation.md) | a silent AVI clip | `MSCOMCT2.OCX` |
| [**CoolBar**](/tB/Packages/Contributed/VBCCR18/CoolBar/index.md) | bands that hold other controls, which the user moves and resizes | `COMCT332.OCX` |
| [**DTPicker**](/tB/Packages/Contributed/VBCCR18/DTPicker.md) | a date or a time, with a drop-down calendar | `MSCOMCT2.OCX` |
| [**ImageCombo**](/tB/Packages/Contributed/VBCCR18/ImageCombo/index.md) | a drop-down list whose items have pictures | `MSCOMCTL.OCX` |
| [**ImageList**](/tB/Packages/Contributed/VBCCR18/ImageList/index.md) | nothing: it holds the pictures other controls show | `MSCOMCTL.OCX` |
| [**ListView**](/tB/Packages/Contributed/VBCCR18/ListView/index.md) | items as icons, a list, tiles or a report with columns | `MSCOMCTL.OCX` |
| [**MonthView**](/tB/Packages/Contributed/VBCCR18/MonthView.md) | a calendar of one or more months | `MSCOMCT2.OCX` |
| [**ProgressBar**](/tB/Packages/Contributed/VBCCR18/ProgressBar.md) | progress through a range | `MSCOMCTL.OCX` |
| [**RichTextBox**](/tB/Packages/Contributed/VBCCR18/RichTextBox/index.md) | formatted text, edited | `RICHTX32.OCX` |
| [**Slider**](/tB/Packages/Contributed/VBCCR18/Slider.md) | a value in a range, set by a thumb on a track | `MSCOMCTL.OCX` |
| [**StatusBar**](/tB/Packages/Contributed/VBCCR18/StatusBar/index.md) | panels of text and pictures along the bottom of a form | `MSCOMCTL.OCX` |
| [**SysInfo**](/tB/Packages/Contributed/VBCCR18/SysInfo.md) | nothing: it reports events and facts of the system | `SYSINFO.OCX` |
| [**TabStrip**](/tB/Packages/Contributed/VBCCR18/TabStrip/index.md) | a row of tabs | `MSCOMCTL.OCX` |
| [**ToolBar**](/tB/Packages/Contributed/VBCCR18/ToolBar/index.md) | a row of buttons | `MSCOMCTL.OCX` |
| [**TreeView**](/tB/Packages/Contributed/VBCCR18/TreeView/index.md) | a tree of nodes that expand and collapse | `MSCOMCTL.OCX` |
| [**UpDown**](/tB/Packages/Contributed/VBCCR18/UpDown.md) | a pair of arrow buttons that change a value | `MSCOMCT2.OCX` |

The [**CommonDialog**](/tB/Packages/Contributed/VBCCR18/CommonDialog.md) class shows the Windows common dialogs, as the CommonDialog control of `COMDLG32.OCX` does. It is a class, not a control: a program makes one with **New**.

## Controls that VB6 does not have

- [**CommandLink**](/tB/Packages/Contributed/VBCCR18/CommandLink.md) -- a button with a title, a note under it and an arrow
- [**FontCombo**](/tB/Packages/Contributed/VBCCR18/FontCombo.md) -- a drop-down list of the fonts installed
- [**HotKey**](/tB/Packages/Contributed/VBCCR18/HotKey.md) -- a box that takes a key combination
- [**IPAddress**](/tB/Packages/Contributed/VBCCR18/IPAddress.md) -- a box for an IPv4 address, in four fields
- [**LinkLabel**](/tB/Packages/Contributed/VBCCR18/LinkLabel/index.md) -- text with links in it
- [**MCIWnd**](/tB/Packages/Contributed/VBCCR18/MCIWnd.md) -- a player for sound and video files
- [**Pager**](/tB/Packages/Contributed/VBCCR18/Pager.md) -- a control that scrolls another control too large for its place
- [**SpinBox**](/tB/Packages/Contributed/VBCCR18/SpinBox.md) -- a text box for a number, with arrow buttons
- [**VirtualCombo**](/tB/Packages/Contributed/VBCCR18/VirtualCombo.md) -- a drop-down list whose items the program supplies when they are shown
- [**VListBox**](/tB/Packages/Contributed/VBCCR18/VListBox.md) -- a list box whose items the program supplies when they are shown
- [**WindowedLabel**](/tB/Packages/Contributed/VBCCR18/WindowedLabel.md) -- text on the form, in a window of its own

## Members that the controls share

Position, size, the font, the mouse and keyboard events, dragging and the other members that nearly every control has are on one page, [Common members](/tB/Packages/Contributed/VBCCR18/Common.md), with the enumerations that several controls use. A control's own page lists which of them it has and documents the rest.

The package also has modules, `ComCtlsBase`, `Common`, `RichTextBoxBase`, `VirtualComboBase`, `VisualStyles` and `VTableHandle`, and a class, `ISubclass`, whose procedures and constants a project can reach. They are the controls' own helper code (subclassing, conversions, the in-place activation of a control and the like), and this section does not document them.

## See Also

- [Contributed Packages](/tB/Packages/Contributed/index.md)
- [WinNativeCommonCtls](/tB/Packages/WinNativeCommonCtls/index.md) -- the built-in package whose common controls have the same names
- [VBFLXGRD18](/tB/Packages/Contributed/VBFLXGRD18/index.md) -- Krool's **VBFlexGrid** control, also a package
- [VBComDlg](/tB/Packages/Contributed/VBComDlg/index.md) -- Krool's **CommonDialog** class as a package of its own
- [Controls](/tB/Controls.md#vb6-controls) -- where each VB6 control is in twinBASIC

## Test cases

The statements of this section that name test cases are checked by the cases in [VBCCR18-tests.twinproj](VBCCR18-tests.twinproj), a twinBASIC project. It uses VBCCR18 as a [linked package](/Features/Packages/Linked.md#manual-management): put the package's `.twinpack` in `%APPDATA%\twinBASIC\packages`, then run the project, and each case prints whether it passes.
