Click here to Skip to main content
15,895,793 members
Home / Discussions / C#
   

C#

 
GeneralRe: Error in Webservice while using datatable Pin
sujithkumarsl18-Apr-07 23:44
sujithkumarsl18-Apr-07 23:44 
QuestionImporting of resources data for Visual Studio 2005 Pin
sfk_ers18-Apr-07 23:38
sfk_ers18-Apr-07 23:38 
QuestionDifference please..... Pin
Uday_Smile18-Apr-07 23:36
Uday_Smile18-Apr-07 23:36 
AnswerRe: Difference please..... Pin
jonwalmsley18-Apr-07 23:41
jonwalmsley18-Apr-07 23:41 
QuestionDataTable.Select - Something strange Pin
jonwalmsley18-Apr-07 23:34
jonwalmsley18-Apr-07 23:34 
QuestionFind System idle time Pin
Subrahmanyam K18-Apr-07 23:18
Subrahmanyam K18-Apr-07 23:18 
AnswerRe: Find System idle time Pin
jonwalmsley18-Apr-07 23:43
jonwalmsley18-Apr-07 23:43 
QuestionHow to localize a WinForm at run-time Pin
Mikael Wiberg18-Apr-07 22:42
Mikael Wiberg18-Apr-07 22:42 
I am wondering if it is possible to localize a WinForms application at run-time.

I would like to create an application where the culture is changed according to what the user selects in a ComboBox. If "sv-SE" is selected the application should behave as a Swedish application, and if "en-US" is selected it should behave as a US English application.
The application will also contain a NumericUpDown Control that is showing a number containing 2 decimals. In Swedish this could be rendered as '0,00' and in English as '0.00' (notice the difference of the decimal separator).

If I write either of the following two lines of code in the constructor of the WinForm - before the InitializeComponent call it all works:

Thread.CurrentThread.CurrentCulture = new CultureInfo("sv-SE");<br />
Application.CurrentCulture = new CultureInfo("sv-SE");


This means however that the user cannot make this change at run-time (constructor and before InitializeComponent).

If I put the following code in a SelectedIndexChanged event-handler of the ComboBox where the culture is selected it has no impact on how the NumericUpDown is rendered:

if(myComboBox.SelectedIndex == 0)<br />
{<br />
    Thread.CurrentThread.CurrentCulture = CultureInfo.CreateSpecificCulture("en-US");<br />
    Thread.CurrentThread.CurrentUICulture = CultureInfo.CreateSpecificCulture("en-US");<br />
    Application.CurrentCulture = CultureInfo.CreateSpecificCulture("en-US");<br />
}<br />
else<br />
{<br />
    Thread.CurrentThread.CurrentCulture = CultureInfo.CreateSpecificCulture("sv-SE");<br />
    Thread.CurrentThread.CurrentUICulture = CultureInfo.CreateSpecificCulture("sv-SE");<br />
    Application.CurrentCulture = CultureInfo.CreateSpecificCulture("sv-SE");<br />
}


Now my question is: is it possible to change this during run-time, and if so, how?
AnswerRe: How to localize a WinForm at run-time Pin
stancrm18-Apr-07 22:49
stancrm18-Apr-07 22:49 
GeneralRe: How to localize a WinForm at run-time Pin
Mikael Wiberg18-Apr-07 22:59
Mikael Wiberg18-Apr-07 22:59 
GeneralRe: How to localize a WinForm at run-time Pin
stancrm18-Apr-07 23:02
stancrm18-Apr-07 23:02 
GeneralRe: How to localize a WinForm at run-time Pin
Mikael Wiberg18-Apr-07 23:24
Mikael Wiberg18-Apr-07 23:24 
AnswerRe: How to localize a WinForm at run-time Pin
Svetlin Panayotov18-Apr-07 23:07
Svetlin Panayotov18-Apr-07 23:07 
GeneralRe: How to localize a WinForm at run-time Pin
Mikael Wiberg18-Apr-07 23:28
Mikael Wiberg18-Apr-07 23:28 
GeneralRe: How to localize a WinForm at run-time Pin
Svetlin Panayotov18-Apr-07 23:51
Svetlin Panayotov18-Apr-07 23:51 
AnswerRe: How to localize a WinForm at run-time Pin
sfk_ers18-Apr-07 23:26
sfk_ers18-Apr-07 23:26 
GeneralRe: How to localize a WinForm at run-time Pin
Mikael Wiberg18-Apr-07 23:29
Mikael Wiberg18-Apr-07 23:29 
QuestionUsing BitBlt to Draw Image Pin
beatles169218-Apr-07 22:11
beatles169218-Apr-07 22:11 
AnswerRe: Using BitBlt to Draw Image Pin
Antony M Kancidrowski19-Apr-07 0:28
Antony M Kancidrowski19-Apr-07 0:28 
AnswerRe: Using BitBlt to Draw Image Pin
Christian Graus19-Apr-07 0:57
protectorChristian Graus19-Apr-07 0:57 
QuestionC# consoleapp [modified] Pin
mhm00118-Apr-07 21:51
mhm00118-Apr-07 21:51 
AnswerRe: C# consoleapp Pin
Guffa18-Apr-07 22:15
Guffa18-Apr-07 22:15 
AnswerRe: C# consoleapp Pin
Colin Angus Mackay18-Apr-07 22:21
Colin Angus Mackay18-Apr-07 22:21 
AnswerRe: C# consoleapp Pin
Svetlin Panayotov18-Apr-07 22:30
Svetlin Panayotov18-Apr-07 22:30 
AnswerRe: C# consoleapp Pin
Guffa18-Apr-07 23:10
Guffa18-Apr-07 23:10 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.