Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Thousands Separator in C# TextBox ?
Message
 
À
02/04/2007 23:46:45
Handi Rusli
PT. Alam Sumbervita
Jakarta, Indonésie
Information générale
Forum:
ASP.NET
Catégorie:
Code, syntaxe and commandes
Versions des environnements
Environment:
C# 2.0
OS:
Windows XP SP2
Network:
Windows 2003 Server
Database:
MS SQL Server
Divers
Thread ID:
01211171
Message ID:
01211617
Vues:
13
I'm not into binding to Textboxes just yet so I can't answer from that perspective. I usually put this whereever I'm populating my controls, Leave Event, etc. I would avoid putting it in the KeyPress event (It's not pretty.). Others (more experienced developers) may have better suggestions. I don't believe there is a direct correlation to VFP's InputMask except in grids (DefaultCellStyle, etc). This was the closest I found.

HTH
Richard


>Thanks Richard :-)
>
>Where should I put this code ?
>
>Is that code mimic behaviour of VFP TextBox's InputMask ?
>
>
>>I hit this too about a month ago. Look into (Taking Mike's suggestion in to account.):
>>
>>
>>
>>decimal somevalue = 1000.00M; // M makes the constant a decimal
>>this.MyTextBox.Text = somevalue.ToString("#,##0.00;(#,##0.00)");
>>
>>
>>In the ToString: prior to the first ; is the positive value representation, after it is the negative value representation.
>>
>>This actually makes for more complex formatting than even VFP.
>>
>>Richard
State of Florida, DCF
Précédent
Répondre
Fil
Voir

Click here to load this message in the networking platform