FIX: Font3D Property Set Incorrectly in THREED.VBX Controls

ID: Q100612

3.00 WINDOWS kbprg kbbuglist

The information in this article applies to:

- Professional Edition of Microsoft Visual Basic programming system

  for Windows, version 3.0

SYMPTOMS

If a Visual Basic version 2.0 for Windows form file contains THREED.VBX controls with the Font3D property set to a value greater than zero, Visual Basic version 3.0 may incorrectly force other THREED.VBX controls to have the same Font3D property value.

CAUSE

The THREED.VBX custom control for Visual Basic 2.0 does not write a Font3D value to the form file if Font3D = 0. When Visual Basic version 3.0 loads he form, after the Visual Basic environment reads a Font3D value for one control, it gives the same Font3D property value to all the rest of the THREED.VBX controls. In other words, if the last THREED.VBX control loaded is the only one that has a Font3D entry in the form file, none of the other controls are affected.

WORKAROUND

To work around the problem, edit the Visual Basic version 2.0 form files that were saved in ASCII text format to add a Font3D = 0 line to any THREED.VBX controls that do not already have a Font3D entry.

Visual Basic version 2.0 form files that were saved in the binary format can be changed after they are loaded into Visual Basic version 3.0.

STATUS

Microsoft has confirmed this to be a bug in the Microsoft products listed at the beginning of this article. This problem has been corrected in Visual Basic version 4.0.

MORE INFORMATION

The following is an example of a Visual Basic version 2.0 form file that was saved in ASCII format with two 3D command buttons. One button has a Font3D value, and one does not. Note that controls are saved in the form file in the opposite order in which they were created on the form.

VERSION 2.00 Begin Form Form1

   Caption         =   "Form1"
   Height          =   6636
   Left            =   828
   LinkTopic       =   "Form1"
   ScaleHeight     =   6216
   ScaleWidth      =   6420
   Top             =   1152
   Width           =   6516
   Begin SSCommand Command3D2
      Caption         =   "Command3D2"
      Font3D          =   1  'Raised w/light shading
      Height          =   1092
      Left            =   720
      TabIndex        =   1
      Top             =   2640
      Width           =   3012
   End
   Begin SSCommand Command3D1
      Caption         =   "Command3D1"
      Height          =   1212
      Left            =   720
      TabIndex        =   0
      Top             =   840
      Width           =   3012
   End
End

Notice that there is not a Font3D setting for Command3D1. If this file were loaded into Visual Basic version 3.0, Command3D1 would have a Font3D value of 1 instead of 0.

To work around the problem, insert the following line between the Caption and Height lines for Command3D1 in the ASCII form file shown above:

   Font3D = 0

Now, Visual Basic version 3.0 will read the file correctly.

The Visual Basic 3.0 THREED.VBX writes the Font3D property to the form file for every THREED.VBX control regardless of its value.

Additional reference words: buglist3.00 3.00 fixlist4.00 KBCategory: kbprg kbbuglist KBSubcategory: PrgCtrlsCus

Keywords          : PrgCtrlsCus kbbuglist
Version           : 3.00
Platform          : WINDOWS
Solution Type     : kbfix

Last Reviewed: November 1, 1997