PRB: OptionButtons Do Not Hold Logical Values

ID: Q245062


The information in this article applies to:
  • Microsoft Visual FoxPro for Windows, versions 5.0, 5.0a, 6.0


SYMPTOMS

In Visual FoxPro 5, it was possible to set OptionButtons to have logical values instead of numeric. However, in Visual FoxPro 6, this behavior changed. While the buttons can be set to logical values, clicking on a button will cause the button's value property to be reset to numeric.


CAUSE

OptionButtons should only have numeric values, even if the interface allows them to be set differently.


STATUS

This behavior is by design.


MORE INFORMATION

Steps to Reproduce Behavior

  1. Run the following code in Visual FoxPro 6.0:


  2. PUBLIC loForm
    loForm = CREATEOBJECT("form")
    loForm.AddObject('opgTest', 'optiongroup')
    loForm.opgTest.ButtonCount = 3
    loForm.opgTest.Option1.Value = .T.
    loForm.opgTest.Option2.Value = .F.
    loForm.opgTest.Option3.Value = .F.
    loForm.opgTest.Visible = .T.
    loForm.opgTest.AutoSize = .T.
    loForm.Visible = .T. 
  3. Open the debugger, and put the following values in the Watch window:


  4. loForm.opgTest.option1.value
    loForm.opgTest.option2.value
    loForm.opgTest.option3.value 
  5. Click on the buttons and watch the debugger.
    • When first run:


    • .T.
      .F.
      .F. 
    • Click Option2:


    • 0
      1
      .F. 
    • Click Option3:


    • 
      0
      0
      1 


Additional query words: kbDSE

Keywords : kbCtrl kbDesigner kbVFp500 kbVFp600 kbGrpFox kbDSupport kbCodeSnippet
Version : WINDOWS:5.0,5.0a,6.0
Platform : WINDOWS
Issue type : kbprb


Last Reviewed: November 16, 1999
© 2000 Microsoft Corporation. All rights reserved. Terms of Use.