Microsoft KB Archive/143064

= DOCERR: ControlBox Property Not Available at Run Time Per Help =

Article ID: 143064

Article Last Modified on 9/30/2003

-

APPLIES TO


 * Microsoft Visual FoxPro 3.0 Standard Edition
 * Microsoft Visual FoxPro 3.0b Standard Edition

-



This article was previously published under Q143064



SUMMARY
The Visual FoxPro Help file topic for the ControlBox property of a form or toolbar says that the ControlBox property is available at design time and read-only at run time. This is incorrect; the ControlBox property is available at design time and at run time.



MORE INFORMATION
The ControlBox property can be changed to true (.T.) or false (.F.). The default value is true, which displays the minus sign in Windows 3.1 and Windows NT or an icon in Windows 95 on the upper left corner of the form. A user can use the control box to move, resize, maximize, minimize, or close a form. The ControlBox property has no effect in Visual FoxPro for Macintosh.

Setting the ControlBox property to false makes the minus sign or icon disappear, so the form can't be changed or closed using the control menu.

On a toolbar, setting the ControlBox property to false disables the minus sign in Windows 3.1 and Windows NT or the X box in Windows 95 that closes the toolbar. So if you want, you can disable the control box of a form or toolbar at run time until a user has performed a certain task. Then you can allow them to change or close a form or toolbar. Following is an example showing how to toggle the ControlBox property in a form at run time from true to false.

Step-by-Step Procedure to Toggle ControlBox Property
 Create a new form, and place a command button on it.  In the click event of the command button, type the following code: IF THISFORM.CONTROLBOX THISFORM.CONTROLBOX=.F.  ELSE THISFORM.CONTROLBOX=.T.  ENDIF  Run the form, and note that there is an icon (a FoxPro head) in Windows 95 and Windows NT 4.0 or a minus sign in Windows 3.1 and Windows NT 3.51 in the upper-left corner of the form. Click the icon or minus sign, and note that there will be a drop down box that will allows the form to be controlled in various ways. After clicking the command button, the icon or minus sign disappears. Clicking the command button again brings back the icon or minus sign.

Additional query words: VFoxWin

Keywords: kbcode KB143064

-

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

© Microsoft Corporation. All rights reserved.