Microsoft KB Archive/194908

= BUG: Control Repaint Problems When ClipControls Set to False =

Article ID: 194908

Article Last Modified on 5/12/2003

-

APPLIES TO


 * Microsoft Visual Basic 6.0 Learning Edition
 * Microsoft Visual Basic 5.0 Learning Edition
 * Microsoft Visual Basic 6.0 Professional Edition
 * Microsoft Visual Basic 5.0 Professional Edition
 * Microsoft Visual Basic 6.0 Enterprise Edition
 * Microsoft Visual Basic 5.0 Enterprise Edition
 * Microsoft Visual Basic 5.0 Control Creation Edition

-



This article was previously published under Q194908



SYMPTOMS
Clicking on an application's icon on the operating system's taskbar causes some controls to disappear.



CAUSE
This problem occurs when a modal form is displayed while a second form in this application is visible in the background and the background form consists of all of the following:


 * 1) Its "ClipControls" property is set to "False."
 * 2) The controls not displaying correctly are child controls of another control rather than placed directly on the form (such as option buttons within a Frame control).

This problem will occur with any type of control as long as the conditions above are met.



RESOLUTION
There are two potential workarounds for this issue:


 * Avoid setting ClipControls to False when a second modal form will be displayed.
 * Leave the ClipControls property set to False but only display non-modal forms.



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



MORE INFORMATION
The following example uses a Frame with OptionButtons to demonstrate this behavior.

Steps To Reproduce
 Create a Standard EXE project in Visual Basic. Form1 is created by default. Add a Frame Control to Form1. Place an OptionButton within the Frame. Place an OptionButton directly on the form. Set the form's "ClipControls" property to "False."</li> Add a CommandButton to Form1.</li>  Paste the following code into Form1's code window: Private Sub Command1_Click Form2.Show vbModal End Sub

</li> From the Project menu, add a second form, Form2, to the Project.</li> Run the Project.</li> Click the CommandButton.</li> Position the forms such that they are both visible.</li> Click the Win95/Win98/WinMe/NT4/Win2000 Taskbar item labeled "Form1." Note that the OptionButton within the Frame control disappears. The OptionButton and CommandButton located directly on Form1 continue to display correctly.</li></ol>

Additional query words: paint

Keywords: kbbug kbctrl kbpending KB194908

-

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

© Microsoft Corporation. All rights reserved.