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:
00383672
Views:
17
> 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
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform