From Friday, April 19th (11:00 PM CDT) through Saturday, April 20th (2:00 PM CDT), 2024, ni.com will undergo system upgrades that may result in temporary service interruption.

We appreciate your patience as we improve our online experience.

Measurement Studio for .NET Languages

cancel
Showing results for 
Search instead for 
Did you mean: 

property editor - Apply invariant culture

Solved!
Go to solution

Hi,

I have a property editor with the following configuration:

 

object: scatterplot

property name: PointSize

 

The problem is that its representation depends on regional settings, for example:

 

Spanish is: "5; 5"

United States is : "5, 5"

 

So how to make it culture invariant in order to represent always in the same manner?

 

0 Kudos
Message 1 of 5
(5,168 Views)
Solution
Accepted by topic author tonitpp

Hi there,

 

Write this peice of code at the beginning of your code.

 

Thread.CurrentThread.CurrentCulture = new CultureInfo("", false);

 

This will make the locale to be set to invariant. But this causes culture to be invariant across the thread.

 

Hope this helps.

 

Vijet Patankar

National Instruments

0 Kudos
Message 2 of 5
(5,162 Views)

@tonitpp wrote:

Hi,

I have a property editor with the following configuration:

 

object: scatterplot

property name: PointSize

 

The problem is that its representation depends on regional settings, for example:

 

Spanish is: "5; 5"

United States is : "5, 5"

 

So how to make it culture invariant in order to represent always in the same manner?

 


EDIT

 

- How to get which character separator is used by the property editor?

- Can I force property editor source to use a custom separator?

 

The need to get the character separator is because I control what user is typing, so I only permits to user to use digits and the character separator so I need to check this character separator to allow user to type it.

 

0 Kudos
Message 3 of 5
(5,161 Views)

Ok, but this will apply culture invariant to all application. Is there any way to know which character separator is using propertyeditorsource?

0 Kudos
Message 4 of 5
(5,160 Views)

@tonitpp wrote:

Ok, but this will apply culture invariant to all application. Is there any way to know which character separator is using propertyeditorsource?


Ok, as you says in the another thread

 

by using CultureInfo.CurrentCulture.TextInfo.ListSeparator.

0 Kudos
Message 5 of 5
(5,155 Views)