Microsoft KB Archive/193401

= BUG: Can't Change UserControl FontTransparent if Default = False =

Article ID: 193401

Article Last Modified on 5/13/2003

-

APPLIES TO


 * Microsoft Visual Basic 6.0 Learning Edition
 * Microsoft Visual Basic 6.0 Professional Edition
 * Microsoft Visual Basic 6.0 Enterprise Edition

-



This article was previously published under Q193401



SYMPTOMS
When the FontTransparent property of a UserControl is programmatically set to True, the UserControl still behaves as if FontTransparent is set to False. The actual property value changes but the behavior does not. Once something has been printed on the control, the FontTransparent can be changed successfully. This problematic behavior occurs only if the FontTransparent property is set to False in design mode.



RESOLUTION
The workaround for this problem is to always set the FontTransparent property of a UserControl to True in design mode. If the design mode value is True, it can be changed programmatically without incident. If it is set to False, the problems described above will occur.



STATUS
Microsoft has confirmed this to be a bug in the Microsoft products listed at the beginning of this article.



Steps to Reproduce Behavior
 Create a Standard EXE project in Visual Basic. Form1 is created default. Select Add Project from the File menu to add an ActiveX Control project to the project group. Assign the Picture property of the UserControl to a large bitmap. Set the FontTransparent property of the UserControl to False.  Add the following code to the UserControl's module: Private Sub UserControl_Click FontTransparent = True Print FontTransparent FontTransparent = False Print FontTransparent FontTransparent = True Print FontTransparent End Sub  Close the UserControl window, and place an instance of the UserControl on Form1.</li> Run the project, and click on the UserControl.</li> Note that the first value printed on the control does not exhibit FontTransparent behavior.</li> Open the UserControl1 project and change the FontTransparent property of the UserControl to True, and then repeat step 7. Note that the behavior is correct.</li></ol>

Additional query words: kbDSupport kbDSD kbVBp kbVBp600bug kbCtrlCreate

Keywords: kbbug KB193401

-

[mailto:TECHNET@MICROSOFT.COM Send feedback to Microsoft]

© Microsoft Corporation. All rights reserved.