Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Disable controlsource default behaviour
Message
 
 
To
29/07/1999 13:02:53
General information
Forum:
Visual FoxPro
Category:
Classes - VCX
Miscellaneous
Thread ID:
00247745
Message ID:
00247803
Views:
25
>I wanted the developer (since I'm going to mass release this) to be able to use controlsource to specify the field, since that is the most intuitively obvious control to hold the field name. Plus, it would be nice to be able to specify this as the default object type for numeric fields, so when you are dragging and dropping from the data environment it will populate automatically.
>
>I think all I have to worry about are the programatic and interactive change events, but I was worried there might be other places.
>
>I think I'll need to check stuff out in the init of the control, so that I make sure of the data type and stuff like that.
>
>>We did something similar but with a date time fields to split up date hours, etc. We added a property which held the control source.
>>
>>Use the lost focus to save your new value.

Using the ControlSource will bind the control and the field. That is why I suggested added a new property [like cFieldSource) to the textbox to store the field reference. Then in the Refresh of the textbox, you have to have:
if type('This.cFieldSource') and !empty(This.cFieldSource)
   This.Value = eval(This.cFieldSource)
endif

In the LostFocus, you have to have:

if type('This.cFieldSource') and !empty(This.cFieldSource)
   replace (This.cFieldSource) with This.value
endif
Of course, you also have to have the other code in the LostFocus that we discussed earlier. You just need to educate the developers on the intent of this control.
Mark McCasland
Midlothian, TX USA
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform