Editing regional settings programming

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

hey lads,

i dont want my clients to change manually regiona settings on pda, so i
thought i could do it coding.
the prob is that i didnt find anything related to that...
does anyone knows how to do it?

many thx

MR
 
Thank you Daniel,

I just need to change the Decima Symbol and the Digit grouping symbol.
Ill try to see if it works :)
 
This is the code im using:
CultureInfo myCl = new CultureInfo ("pt-PT",false);
myCl.NumberFormat.NumberDecimalSeparator = ".";
myCl.NumberFormat.NumberGroupSeparator = " ";

im doing when loading the frmMain.
If i write "," on a textbox, it doesnt change to "."
what is wrong?
 
You have created a Portuguese CultureInfo object. You can now use this to
pass it to methods that accept a CultureInfo object as a parameter (e.g.
Convert.ToDouble). Such methods would then use your object for their
formatting rules.

The textbox has nothing to do with your object (it doesn't know about it).
The UI CultureInfo object (if you like think of it as a single global place
for all the formatting rules) picks up its settings from the OS.

Therefore any changes you would like to apply globally (whether language or
formatting rules) must be made to the OS (and then restart your app for it
to pick up the changes).

My previous reply (and the thread it points to) show you how to do it for
the language. I have not had to override a specific setting myself (like the
decimal separator only), but I am sure if you search in MSDN you will find
something.

Cheers
Daniel
 
Back
Top