Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Grid control and dynamic lookup
Message
 
To
16/11/2007 12:57:00
Spencer Redfield
Managed Healthcare Northwest, Inc.
Portland, Oregon, United States
General information
Forum:
Visual FoxPro
Category:
Forms & Form designer
Environment versions
Visual FoxPro:
VFP 8 SP1
OS:
Windows XP SP2
Network:
Windows NT
Database:
Visual FoxPro
Miscellaneous
Thread ID:
01267478
Message ID:
01269581
Views:
17
Spencer,

>I'm not sure that the combobox suggestion will work because I have simply *not* been able to make a ComboBox whose STYLE = 2 be READONLY, even with ALLOWCELLSELECTION set to .F.. Except for the lack of READONLY this control would have met my needs.

If you're talking about just the ReadOnly *property* of the control, then you're correct -- VFP specifically does not allow a ComboBox set to Style = 2 to also have ReadOnly = .T. (the help file states this).

However, since Style = 2 disallows any data entry in the control, you can emulate the "read only" behavior you're looking for without setting that specific property using the following approach:
1) Set TabStop = .F.
2) Set Enabled = .F.
3) Set ColorSource = 0 (Object's Color Properties)
4) Set DisabledForeColor/DisabledBackColor/DisabledItemForeColor/DisabledItemBackColor to the same values as ForeColor/BackColor/ItemForeColor/ItemBackColor, respectively (if you want black, make sure to use 1,1,1 instead of 0,0,0 -- for some reason, VFP wants to display "no color" as gray when the control is disabled).

Now, your users cannot navigate to the control in any manner (tab/click), yet its values can still be manipulated programmatically and displayed to the user.

HTH.

>Thank you very much for your reply and suggestions.
>
>I'm not sure that the combobox suggestion will work because I have simply *not* been able to make a ComboBox whose STYLE = 2 be READONLY, even with ALLOWCELLSELECTION set to .F.. Except for the lack of READONLY this control would have met my needs.
>
>Unfortunately this application is still in VFP 8 and as you know VFP 8 doe not include RecordSourceType = 10.
>
>In VFP 9's property sheet when I set the RecordSourceType to 10 (collection) and attempt to set the control to READONLY it will not change (remains .F.). Is it your understanding that RecordSourceType = 10 in a STYLE = 2 dropdown permits READONLY?
>
>Thanks again for your kind reply.
>
>Spencer
Evan Pauley, MCP
Positronic Technology Systems LLC
Knoxville, TN

If a vegetarian eats vegetables, what does a humanitarian eat?
Previous
Reply
Map
View

Click here to load this message in the networking platform