FIX: Toolkit 3-D Option & Check Controls Don't Repaint in 3.1 (84475)
The information in this article applies to:
- Microsoft Visual Basic Standard Edition for Windows 2.0
- Microsoft Professional Toolkit for Microsoft Visual Basic programming system for Windows
This article was previously published under Q84475 SYMPTOMS
The 3-D Option Button and 3-D Check Box custom controls in the
THREED.VBX file do not paint properly if their Value property is
changed while the form is loaded (hidden) before being shown. The
caption area appears transparent (not painted) until the user clicks
it or until the Value is changed in code after the form is shown. This
problem occurs only in Windows version 3.1, not Windows version 3.0.
CAUSE
This problem occurs because of changes in the Windows GDI routines
to optimize screen refresh performance. For that reason, Windows
version 3.1 eliminates what it considers redundant paints.
WORKAROUND
You can work around this problem by assigning the Caption property of
the affected controls to themselves when the form is shown again. This
code would be placed after the Form2.Show. For example:
Form.Control.Caption = Form.Control.Caption
This forces a refresh of the area not being painted. Here are the steps
to implement this workaround:
- Add the following code to the Command2_Click event:
Sub Command2_Click ()
Option3D3.Value=1
Check3D3.Value=1
Form2.Show
Form2.Option3D1.Caption = Form2.Option3D1.Caption
Form2.Option3D2.Caption = Form2.Option3D2.Caption
Form2.Option3D3.Caption = Form2.Option3D3.Caption
Form2.Check3D1.Caption = Form2.Check3D1.Caption
Form2.Check3D2.Caption = Form2.Check3D2.Caption
Form2.Check3D3.Caption = Form2.Check3D3.Caption
End Sub
- Run the program. Change the values by clicking some checks and
options.
- Click Form2 to hide it.
- Click the Second Show and notice that the paint is now handled
correctly.
You can also work around this problem by explicitly doing a SetFocus
call on the control(s) in question. If you are using control array(s),
it should be fairly easy. For example, if you had a five-element
control array of Check3D1 check boxes, use this code:
Sub Form_Paint()
For a% = 0 to 4
Check3D1(a%).SetFocus
Next
End Sub
RESOLUTION
Sheridan Software, manufacturer of the 3-D Check Box and 3-D Option
Button controls, has issued an update to THREED.VBX that corrects the
painting problems experienced in Windows version 3.1. To obtain this
update, call the Sheridan BBS at (516) 753-5452 (2400 baud) or (516)
753-6510 (9600 baud).
STATUS
Microsoft has confirmed this to be a bug in the products listed above
when used in Microsoft Windows version 3.1. This problem was corrected
in Microsoft Visual Basic version 3.0 for Windows.
Modification Type: | Minor | Last Reviewed: | 8/16/2005 |
---|
Keywords: | kbbug kbfix KB84475 |
---|
|