Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Multi-functional textbox
Message
De
23/06/2000 10:41:16
 
 
Information générale
Forum:
Visual FoxPro
Catégorie:
Classes - VCX
Divers
Thread ID:
00383562
Message ID:
00383759
Vues:
17
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
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform