PRB: TransparentPaint Backstyle Option UnavailableLast reviewed: September 24, 1997Article ID: Q174216 |
The information in this article applies to:
SYMPTOMSThe Visual Basic 5.0 documentation discusses a TransparentPaint option for the BackStyle property of the UserControl. However, this feature was not implemented in the product. Without this option, it is not possible to create a completely transparent ActiveX Control using Visual Basic. If you need a transparent ActiveX Control, develop the control using Microsoft Visual C++. This presents two problems when working with ActiveX controls created using Visual Basic. Transparent controls cannot be drawn on and they do not respond to events that occur on the control; these events are passed on to the container.
RESOLUTIONThere is no way to simulate the TransparentPaint option, but under some circumstances it may be possible to achieve the desired result. There are two such situations:
STATUSMicrosoft is researching this problem and will post new information here in the Microsoft Knowledge Base as it becomes available.
MORE INFORMATION
Background Color Matching with the ContainerIf the container has a solid color background, the backcolor of your UserControl can be set to match the backcolor of the container. This has the same effect as transparency. To accomplish this, add the following code to your UserControl's Paint Event:
BackColor = Parent.Backcolor Using a "Hot Spot" BitmapThe UserControl has two properties that can be used to create transparent areas on the control: MaskColor and MaskPicture. These properties allow you to have non-transparent areas on a transparent control that will respond to events and can be drawn on. The transparent areas on the control, however, will still not respond to events and cannot be drawn on.
Step-by-Step Example
Although it is not demonstrated here, the non-transparent area of the UserControl can also be drawn on.
REFERENCESReadme.hlp Keywords : vb5all VBKBAX VBKBComp VBKBCtrl kbdocerr Version : WINDOWS:5.0 Platform : WINDOWS Issue type : kbdocerr kbprb |
================================================================================
© 1998 Microsoft Corporation. All rights reserved. Terms of Use. |