This article was previously published under Q184687
This article has been archived. It is offered "as is" and will no longer be updated.
This article contains information about the lightweight, or windowless,controls that ship with Visual Basic version 6.0. This article alsodescribes lightweight controls, explains their advantages anddisadvantages, and illustrates how to install lightweight controls in yourVisual Basic project.
Lightweight controls, sometimes referred to as windowless controls, aresimilar to the regular controls shipped in Visual Basic except that they donot have a window handle. Because lightweight controls do not have a windowhandle, these controls use less system resources. Lightweight controls areideal for projects where system resources might be a limiting factor, suchas Internet applications and distributed applications.
Lightweight controls with a Transparent BackStyle property are trulytransparent. A regular control might appear to be transparent under thesame conditions. However, the control is still processing Windows messagesin that transparent background area. When a lightweight control has atransparent background, the container holding the lightweight controlactually processes the Windows messages instead of the lightweight control.Because lightweight controls are truly transparent, these controls can beany shape.
There are some disadvantages to lightweight controls. Lightweight controlcontainers can only contain other lightweight controls. If you put aregular control in a lightweight control container, the container willrevert to a regular window control container. Regular controls alwaysappear on top of a lightweight control because the lightweight control usesthe resources of the parent window.
When you run Visual Basic, the following controls in your Toolbox arelightweight controls:
In addition to these intrinsic lightweight controls, following are otherlightweight controls included in the component file MSWLess.ocx that shipswith Visual Basic 6.0:
To use these controls in your Visual Basic program, you must complete thefollowing steps:
Register the windowless component file in your system registry.
Copy the component file and help files to the appropriate directories in your system.
Add the ActiveX controls to your Visual Basic program.
How To Register the Windowless Component File
Search for the registration file, MSWLess.reg, on your Visual Basic installation disks. The file is located in the Common\Tools\Vb\WinLess directory on disk 1. NOTE: The windowless controls are in the following location on the August 1998 MSDN CDs: Disk3\Common\Tools\VB\Winless.
Double-click MSWLess.reg. The following Registry Editor dialog box appears when you have successfully registered the windowless component file:
Information in the Common\Tools\Vb\WinLess\MSWLess.reg has been successfully entered into the registry.
You have just registered the windowless component file. The next sectionshows you how to copy the appropriate windowless component and Help filesto your computer.
How To Copy the Windowless Component Files
Search for the following files on your Visual Basic installation disks. These files are located in the Common\Tools\Vb\WinLess directory on disk 1.
Filename Description ------------------------------------------------------------------------ ltwtct98.chi Help file on windowless controls. ltwtct98.chm Help file on windowless controls. MSWLess.ocx Windowless component file with the windowless ActiveX Controls.
Copy the two Help files to your local Windows\Help directory.
Copy the windowless component file, MSWLess.ocx, to your local Windows\System directory.You have just copied all the necessary windowless component files. The nextsection shows you how to add a windowless control to your Visual Basicprogram.
How To Add a Windowless Control To Your Project
Start a new project in Visual Basic.
From the Project menu, click Components. The Components dialog box appears.
From the Controls tab, select the Microsoft Windowless Controls 6.0 check box.
Click OK to close the Components dialog box. All the windowless controls appear on the toolbar.