INFO: Lightweight Controls in Visual Basic 6.0

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:
  • Image Control
  • Label Control
  • Line Control
  • Shape Control
In addition to these intrinsic lightweight controls, following are otherlightweight controls included in the component file MSWLess.ocx that shipswith Visual Basic 6.0:
  • WLCheck Control
  • WLCombo Control
  • WLCommand Control
  • WLFrame Control
  • WLHScroll Control
  • WLVScroll Control
  • WLList Control
  • WLOption Control
  • WLText Control
To use these controls in your Visual Basic program, you must complete thefollowing steps:
  1. Register the windowless component file in your system registry.
  2. Copy the component file and help files to the appropriate directories in your system.
  3. Add the ActiveX controls to your Visual Basic program.

How To Register the Windowless Component File

  1. 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.
  2. 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

  1. 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.					
  2. Copy the two Help files to your local Windows\Help directory.
  3. 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

  1. Start a new project in Visual Basic.
  2. From the Project menu, click Components. The Components dialog box appears.
  3. From the Controls tab, select the Microsoft Windowless Controls 6.0 check box.
  4. Click OK to close the Components dialog box. All the windowless controls appear on the toolbar.
"Creating Lightweight Controls", Visual Basic Product Documentation

For additional information about lightweight controls, please see the following article in the Microsoft Knowledge Base:
184645 HOWTO: Create Lightweight Controls with Visual Basic 6.0
For additional installation instructions, please see the following articles in the Microsoft Knowledge Base:
189950 HOWTO: Install the Microsoft Windowless Controls for VB6
For additional information, click the article number below to view the article in the Microsoft Knowledge Base:
259564 INFO: Windowless Controls in the Mswless.ocx File Are Not Supported

Article ID: 184687 - Last Review: 02/21/2014 00:29:13 - Revision: 2.1

  • Microsoft Visual Basic 6.0 Learning Edition
  • Microsoft Visual Basic 6.0 Professional Edition
  • Microsoft Visual Basic 6.0 Enterprise Edition
  • kbnosurvey kbarchive kbinfo kbctrl KB184687