...Regional Settings...Again...

P

Peter B

I think you can override the device's localization with your own if that
would solve your problem. I don't know exactly how this is done (don't have
the code infront of me), and I am not 100% it works as you want.

Another solution would be to check the Regional settings at startup and
prompt the user to change them if they aren't correct...

/ P
 
F

Felipe T.

Hi, here we go again.
Thanks for every solution u guys posted to me
Using a Decimal as a String solves the problem,
but i write too much to use the right decimal settings.

The most simple solution i see is to change the Regional Settings,
a simple "," becames a ".". And voilá, The magic is made.

I know there is some desktop APIs like VerLanguagename and
GetCurrencyFormat (kernerl32). The .Net CF framework also provides functions
to retrieve that information.

But when it comes to Write that information...I know no way...
Maybe these settings r hidden in registry?

Well, ill keep on using the String solution.
And trying new solutions.

If anyone know how to help,
ill b most thankfull.

Felipe
 
F

Fernando

HI Felipe, the regional settings properties are picked up by NETCF at load
time, so CultureInfo.CurrentCulture will contain objects
(DateTimeFormatInfo for ex) that expose those properties, having that said,
these default values connot be changed from managed code but there are a
few things you can do to workarround this:

1) Create a new CultureInfo object and modify the DateTimeFormat property.
1.1) Then pass the created CultureInfo object to any method that will need
it like Decimal.ToString(IFormatProvider)

Also you can modify the registry entries Pinvoking to native code, but bear
in mind that you will need to do that before the application appdomain gets
created in order to pick up the changes.

Hope this helps,
Fernando

Some usefuls links:
http://msdn.microsoft.com/library/default.asp?url=/library/en-us/cpref/html/
frlrfsystemdecimalclasstostringtopic2.asp
http://msdn.microsoft.com/mobility/ --> mobile development home page
http://msdn.microsoft.com/mobility/understanding/articles/default.aspx -->
technical articles

This posting is provided "AS IS" with no warranties, and confers no rights.
--------------------
| From: "Felipe T." <[email protected]>
| Subject: ...Regional Settings...Again...
| Date: Wed, 28 Jan 2004 11:09:46 -0300
| Lines: 24
| X-Priority: 3
| X-MSMail-Priority: Normal
| X-Newsreader: Microsoft Outlook Express 6.00.2800.1106
| X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2800.1106
| Message-ID: <#[email protected]>
| Newsgroups: microsoft.public.dotnet.framework.compactframework
| NNTP-Posting-Host: 200.244.33.250
| Path:
cpmsftngxa07.phx.gbl!cpmsftngxa10.phx.gbl!TK2MSFTNGXA05.phx.gbl!TK2MSFTNGP08
.phx.gbl!TK2MSFTNGP10.phx.gbl
| Xref: cpmsftngxa07.phx.gbl
microsoft.public.dotnet.framework.compactframework:44240
| X-Tomcat-NG: microsoft.public.dotnet.framework.compactframework
|
| Hi, here we go again.
| Thanks for every solution u guys posted to me
| Using a Decimal as a String solves the problem,
| but i write too much to use the right decimal settings.
|
| The most simple solution i see is to change the Regional Settings,
| a simple "," becames a ".". And voilá, The magic is made.
|
| I know there is some desktop APIs like VerLanguagename and
| GetCurrencyFormat (kernerl32). The .Net CF framework also provides
functions
| to retrieve that information.
|
| But when it comes to Write that information...I know no way...
| Maybe these settings r hidden in registry?
|
| Well, ill keep on using the String solution.
| And trying new solutions.
|
| If anyone know how to help,
| ill b most thankfull.
|
| Felipe
|
|
|
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top