Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Read Only Combo Box and Option Group
Message
General information
Forum:
Visual FoxPro
Category:
Forms & Form designer
Miscellaneous
Thread ID:
00049624
Message ID:
00049723
Views:
63
>>Since there is no selection in the preferences menu for making items such as Combo Bodes, Spinners and Option Groups read only, is there a line of code I can write in a particular property that will make them so? I'd rather they couldn't edit the data in those fields unless they click the edit button.
>
>Combo.Enabled=.F.

Alternatively, Shawn, if you don't want the 'grayed out' look of Enabled = .f., you can set a form property that is TRUE for readonly = TRUE, FALSE otherwise. In the WHEN method of your combo, option group, etc. put a line
IF thisform.ReadOnlyProp = .T.
   return .F.
ELSE
   return .T.
ENDIF
This keeps the control(s) from getting focus at all, but they still LOOK as if they were 'live', matching the other controls you changed with SetAll()

You'll find this form property is useful in many other ways, such as button captions.

HTH
Barbara
Barbara Paltiel, Paltiel Inc.
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform