views:

491

answers:

3

Hi there is possible to set a default language or set a new one in RichTextBox, i want to set it in "es-PE" for spellchecker propouses

Thanks!

+1  A: 

Have you tried setting the current thread's culture to the one you want? Most stuff in .NET takes the culture from the thread.

Thread.CurrentThread.CurrentCulture = new Culture( "es-PE" );
Thread.CurrentThread.CurrentUICulture = Thread.CurrentThread.CurrentCulture;
Rob Prouse
This would effect all of the RichTextBox controls in the application
John
cant find Culture Namespace
Angel Escobedo
A: 

...RichTextBox Language="es-PE" Name="mainRTB" AcceptsTab="True" SpellCheck.IsEnabled="True"...

sorry i was thinking extending the control and using System.Windows.Forms.InputLanguage ...(fx 2.0)

Angel Escobedo
+2  A: 

It would seem to be possible setting the xml:lang as in the code below:

   <StackPanel>
    <RichTextBox SpellCheck.IsEnabled="True"/>
    <RichTextBox SpellCheck.IsEnabled="True" xml:lang="es-PE"/>
</StackPanel>

The first box checks in the default culture and the second in the specified one ("es-PE").

The documentation also suggests you could add this attribute to a parent control such as a panel and it will be inherited by the child controls.

John