VB Toolkit 3-D Option and Check Controls Don't Repaint in 3.1

ID Number: Q84475

1.00

WINDOWS

buglist1.00

Summary:

The following problem occurs under Windows version 3.1 but not under

3.0. The 3-D Option Button and 3-D Check Box custom controls in the

Professional Toolkit (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 on it, or if the Value is changed in code after

the form is shown. This problem occurs because of changes in the

Windows GDI routines to optimize screen refresh performance. For that

reason, Windows 3.1 eliminates what it considers redundant paints.

Microsoft has confirmed this to be a problem in Microsoft Professional

Toolkit for Visual Basic programming system version 1.0 under Windows

3.1.

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 under Windows 3.1. To obtain this

update, call the Sheridan BBS at (516) 753-0985 (2400 baud) or (516)

753-6510 (9600 baud).

More Information:

Workaround

----------

The workaround is to assign the Caption property of the affected

controls to themselves when the form is shown again. This code would

be placed after Form2.Show. For example:

Form.Control.Caption = Form.Control.Caption

This forces a refresh of the area not being painted.

1. 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

2. Run the program. Change the values by clicking on some checks and

options.

3. Click on Form2 to hide it.

4. Click the Second Show and notice that the paint is now handled

properly.

Steps to Reproduce Problem

--------------------------

1. Run Visual Basic, or from the File menu, choose New Project (ALT,

F, N) if Visual Basic is already running. Form1 is created by

default. Add a second form (Form2).

2. From the File menu, choose Add File. In the Files box, select the

THREED.VBX custom control file. The 3-D tools appear in the

Toolbox.

3. Add the following controls to the forms, and set their properties to

the following:

Form1:

Control Property Setting

------- -------- -------

Form FormName Form1

Command button CtlName Command1

Command button Caption First Show

Command button CtlName Command2

Command button Caption Second Show

Form2:

Control Property Setting

------- -------- -------

Form FormName Form2

3-D Check box CtlName Check3D1

3-D Check box CtlName Check3D2

3-D Check box CtlName Check3D3

3-D Option button CtlName Option3D1

3-D Option button CtlName Option3D2

3-D Option button CtlName Option3D3

4. Add the following code to Command1_Click (Form1):

Sub Command1_Click

Form2.Option3D1.Value=1 'set values for first show

Form2.Check3D1.Value=1

Form2.Show

End Sub

5. Add the following code to Command2_Click (Form1):

Sub Command2_Click ()

Form2.Option3D3.Value=1

Form2.Check3D3.Value=1

Form2.Show

End Sub

6. Add the following code to the Form_Click event of Form2:

Sub Form_Click ()

Form2.Hide

End Sub

7. Run the program.

When you click the First Show button, the paint occurs properly for

all controls, including the controls whose values were changed in code

prior to the show. On Form2, click an option box and a check box to

change Values.Click on Form2 to hide the form. Click the Second Show

button. The controls whose value was changed prior to the form being

shown are only painted around the area with the check box or option

box. The rest of the area is unpainted.

Reference(s):

Sheridan Software Systems, Inc.

65 Maxess Road

Melville, NY 11747

Phone: (516) 753-0985

Fax: (516) 293-4155

Additional reference words: 1.00 3.10