Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to receive event when user changes system's culture

When my application run with a specified culture. Don't close the application, user changes system's culture, ex: change number decimal separator from "." to ",". How to my application can catch this event. Thanks.

Notes: C# 2.0, Windows Form.

like image 489
Leo Vo Avatar asked Jan 17 '11 09:01

Leo Vo


1 Answers

You can handle the SystemEvents.UserPreferenceChanged event:

void SystemEvents.UserPreferenceChanged(object sender, UserPreferenceChangedEventArgs e)
{
    // Regional settings have changed
    if (e.Category == UserPreferenceCategory.Locale)
    {
        ...
    }
}
like image 58
Thomas Levesque Avatar answered Oct 21 '22 11:10

Thomas Levesque