Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Multi-functional textbox
Message
 
 
To
23/06/2000 10:41:16
General information
Forum:
Visual FoxPro
Category:
Classes - VCX
Miscellaneous
Thread ID:
00383562
Message ID:
00383766
Views:
13
Hi Daniel and everyone,

I'm writing the code right now. I choosed LostFocus event of combobox as Jim suggested.
The related problem: - how can I find the number of digits in Numeric field, e.g. Numeric 5.3 fsize() would return 9. I'd like to set InputMask to "99999.99"
And what about alignment?

>Nadya:
>
>This is a silly example of what you want:
>
>In the DropdownListBox - Init event
>(Yopu can add more colums for format, input mask). Just make sure everything is a character
>
>THIS.AddListItem('Character', 1, 1)
>THIS.AddListItem('C', 1, 2)
>THIS.AddListItem('Hello Nadya', 1, 3)
>
>THIS.AddListItem('Numeric', 2, 1)
>THIS.AddListItem('N', 2, 2)
>THIS.AddListItem('100.00', 2, 3)
>
>THIS.AddListItem('Date', 3, 1)
>THIS.AddListItem('D', 3, 2)
>THIS.AddListItem('{}', 3, 3)
>
>In the InteractiveChange event (I assume the TextBox is called txtValue)
>lnIndex = THIS.ListIndex
>lcDataType = THIS.List[lnIndex, 2]
>lcValue = THIS.List[lnIndex, 3]
>WAIT WINDOW STR(lnIndex,1,0) + ' ' + LTRIM(lcDataType) + ' ' + lcValue
>WITH THISFORM.txtValue
> DO CASE
> CASE lcDataType == 'C'
> .Format = ''
> .InputMask = ''
> .Value = lcValue
> .Format = 'R'
> .InputMask = 'XXXXXXXXXX'
> CASE lcDataType == 'N'
> .Format = ''
> .InputMask = ''
> .Value = VAL(lcValue)
> .Format = ''
> .InputMask = '99,999.99'
> CASE lcDataType == 'D'
> .Format = ''
> .InputMask = ''
> .Value = CTOD(lcValue)
> .Format = 'D'
> .InputMask = ''
> ENDCASE
>ENDWITH
>
>Daniel
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