FIX: Controls Cannot Be Added to Toolbar Programmatically (172343)
The information in this article applies to:
- Microsoft Visual Basic Learning Edition for Windows 5.0, when used with:
- the operating system: Microsoft Windows NT
- the operating system: Microsoft Windows 95
- Microsoft Visual Basic Learning Edition for Windows 6.0, when used with:
- the operating system: Microsoft Windows NT
- the operating system: Microsoft Windows 95
- Microsoft Visual Basic Professional Edition for Windows 5.0, when used with:
- the operating system: Microsoft Windows NT
- the operating system: Microsoft Windows 95
- Microsoft Visual Basic Professional Edition for Windows 6.0, when used with:
- the operating system: Microsoft Windows NT
- the operating system: Microsoft Windows 95
- Microsoft Visual Basic Enterprise Edition for Windows 5.0, when used with:
- the operating system: Microsoft Windows NT
- the operating system: Microsoft Windows 95
- Microsoft Visual Basic Enterprise Edition for Windows 6.0, when used with:
- the operating system: Microsoft Windows NT
- the operating system: Microsoft Windows 95
- Microsoft Visual Basic Standard Edition, 32-bit, for Windows 4.0, when used with:
- the operating system: Microsoft Windows NT
- the operating system: Microsoft Windows 95
- Microsoft Visual Basic Professional Edition, 32-bit, for Windows 4.0, when used with:
- the operating system: Microsoft Windows NT
- the operating system: Microsoft Windows 95
- Microsoft Visual Basic Enterprise Edition, 32-bit, for Windows 4.0, when used with:
- the operating system: Microsoft Windows NT
- the operating system: Microsoft Windows 95
- Microsoft Visual InterDev 1.0, when used with:
- the operating system: Microsoft Windows NT
- the operating system: Microsoft Windows 95
This article was previously published under Q172343 SYMPTOMS
With Visual Basic, you may add controls to a Toolbar control by creating a
placeholder button on the toolbar and then setting the control to the same
position. If you use the Comctl32.ocx that ships with Visual Studio 97 and
Visual Basic 5.0, or MSCOMCTL.OCX that ships with Visual Studio 6.0 and
Visual Basic 6.0, the control may unexpectedly appear behind the toolbar.
RESOLUTION
To work around this problem, create a pause with DoEvents after you set all
the controls in place and then set the Toolbar control to the bottom of the
ZOrder.
NOTE: This workaround does not apply to non-windowed controls, such as a
Label or a Shape. To use this workaround with non-windows controls,
the controls must be contained in a PictureBox.
STATUS
Microsoft has confirmed this to be a bug in the Microsoft products listed
at the beginning of this article. For Visual Studio 6.0 and Visual Basic 6.0 using MSCOMCTL.OCX, this behavior has been resolved with Service Pack 3.
Modification Type: | Major | Last Reviewed: | 6/24/2004 |
---|
Keywords: | kbBug kbControl kbfix kbVS600sp3fix KB172343 |
---|
|