Visual Basic Concepts

Upgrading Applications that Use the Windows Common Controls

The Windows common controls have been upgraded to include new controls and functions and to use new file names.

Visual Basic ships with two versions of the Windows common controls. The first version is for backward compatibility only and should be used when you do not want to upgrade an existing application to use the new version.

Why Upgrade?

Visual Basic version 5.X common controls were contained in two .OCX files: ComCtl32.ocx and ComCt232.ocx. Both of these files called into the ComCtl32.dll file, a system file, for functionality. The new control versions are contained in two new files: MsComCtl.ocx and MsComCt2.ocx. Neither of these files are linked to the ComCtl32.dll file. Besides the new controls added to these files, another reason for upgrading is easier distribution and maintenance. The file changes are summarized below:

Old File Name New File Name
ComCtl32.ocx MsComctl.ocx
ComCt232.ocx MsComct2.ocx
ComCtl32.dll -- This file is not needed.

How to Upgrade

When an application — created with Visual Basic version 5 and using these controls — is first loaded in Visual Basic version 6, a dialog box will appear informing you that a new version is available, and that the controls can be upgraded. At that time, you can choose to upgrade the project to the new controls, or continue to use the older control versions.

If you do not wish to upgrade the application, you can prevent this dialog from appearing by unchecking the "Upgrade ActiveX Controls" option found in the Project Name Properties dialog box (from the Project menu), however by doing so all upgrade messages will be turned off for the project. You can further confirm which version of the controls is being used by opening the Components dialog box (from the Project menu), and checking which file name is associated with the checked "Microsoft Windows Common Controls X.X". The version number is 5.0 for the old files, and 6.0 for the new.

List of Windows Common Controls

The new files contain the following controls:

File Control
MsComctl.ocx TreeView

ListView

ProgressBar

Slider

ImageList

Toolbar

TabStrip

StatusBar

ImageCombo

MsComct2.ocx Animation

UpDown

MonthView

DateTimePicker

FlatScrollBar