Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Multi-functional textbox
Message
General information
Forum:
Visual FoxPro
Category:
Classes - VCX
Miscellaneous
Thread ID:
00383562
Message ID:
00383691
Views:
15
>> Let me explain the problem more precisily: We have a form called "Global Editor". It has a combobox with fields, which could be replaced with some value, whcih a user can enter in a textbox. Now there is a problem: how can I figure out, what data type value is entered? I thought about doing this in opposite way: after user selects a field from combobox, check its type and either use appropriate InputMask or Format property or AddObject(correctFieldTypeTextBox) and Remove the previous textbox. It would be a little hassle.
>
>Nadu=ya,
>
>I would load the combo with the field name and its data type. I would not show the data type in the combo but read it from the combo. I would then use the data type to set a beginning value to the textbox so the data type of the textbox.Value would be correct. Soemthing like this in the combo's LostFocus;
>
>
>LOCAL lcType
>lcType = THIS.List(This.ListIndex,2)
>DO CASE
>   CASE lcType = "C"
>      This.Parent.Text1.Value = ""
>   CASE lcType $ "NFYI"
>      This.Parent.Text1.Value = 0
>   CASE lcType $ "DT"
>      This.Parent.Text1.Value = {}
>   CASE lcType = "L"
>      This.Parent.Text1.Value = .F.
>...
>ENDCASE
Hi Jim,

I thought the same as you suggested, but here is a problem: Once assigned textbox value, say, 0, could not be changed to {} after all, right? Therefore the combobox could be used just once, not for multiple replaces... This was my original concern, that's why I was thinking about RemoveObject() and NewObject()... But if my above assumption is wrong and a textbox could change its data type on the fly, the solution would be exactly as you described.

Thanks for your help.
If it's not broken, fix it until it is.


My Blog
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform