С language windows forms

Form. Input Language Changing Событие

Определение

Происходит, когда пользователь пытается изменить язык заполнения формы. Occurs when the user attempts to change the input language for the form.

Тип события

Примеры

В следующем примере демонстрируется использование этого элемента. The following example demonstrates the use of this member. В этом примере обработчик событий сообщает о возникновении InputLanguageChanging события. In the example, an event handler reports on the occurrence of the InputLanguageChanging event. Этот отчет поможет вам узнать, когда происходит событие и может помочь при отладке. This report helps you to learn when the event occurs and can assist you in debugging. Чтобы сообщить о нескольких событиях или о событиях, которые происходят часто, рассмотрите возможность замены MessageBox.Show Console.WriteLine или добавления сообщения в многострочный TextBox . To report on multiple events or on events that occur frequently, consider replacing MessageBox.Show with Console.WriteLine or appending the message to a multiline TextBox.

Чтобы выполнить пример кода, вставьте его в проект, содержащий экземпляр типа Form с именем Form1 . To run the example code, paste it into a project that contains an instance of type Form named Form1 . Затем убедитесь, что обработчик событий связан с InputLanguageChanging событием. Then ensure that the event handler is associated with the InputLanguageChanging event.

Комментарии

Это событие происходит перед изменением языка ввода для формы. This event occurs before the change of input language is made for the form. Вы можете отменить изменение языка, задав Cancel свойству объекта, InputLanguageChangingEventArgs переданного обработчику событий, значение false . You can cancel the language change by setting the Cancel property of the InputLanguageChangingEventArgs passed to your event handler to false . Если событие отменено, язык ввода не изменяется. If the event is canceled, the input language is not changed. Это событие можно использовать для определения того, подходит ли запрошенное изменение языка ввода для вашего приложения. You can use this event to determine whether the requested input language change is appropriate for your application.

Дополнительные сведения об обработке событий см. в разделе обработка и вызов событий. For more information about handling events, see Handling and Raising Events.

Input Language Class

Definition

Provides methods and fields to manage the input language. This class cannot be inherited.

Examples

The following code example gets a list of installed languages. The example requires that textBox1 has been instantiated and that textBox1.MultiLine has been set to true .

The next example sets the default input language as the current input language. The example requires that textBox1 has been instantiated and that textBox1.MultiLine has been set to true .

Читайте также:  Зарезервируйте обновление для windows 10

Remarks

An input language is a culture/keyboard layout pair that determines how the physical keys on a keyboard map or plot to characters in a language. The input language is based on a Windows input locale identifier, such as that returned by the Platform SDK function, GetKeyboardLayout . The input locale identifier is also called a handle to a keyboard layout (HKL) value.

Use the static methods provided to find all installed mappings of the system and to change the input language for a thread or process. Call CurrentInputLanguage to get the current input language. Call DefaultInputLanguage for the default input language. Call InstalledInputLanguages to get all the installed languages in this system. After you have a list of all the installed languages, use CurrentInputLanguage to change the current input language to a different language.

Properties

Gets the culture of the current input language.

Gets or sets the input language for the current thread.

Gets the default input language for the system.

Gets the handle for the input language.

Gets a list of all installed input languages.

Gets the name of the current keyboard layout as it appears in the regional settings of the operating system on the computer.

Methods

Specifies whether two input languages are equal.

Returns the input language associated with the specified culture.

Returns the hash code for this input language.

Gets the Type of the current instance.

(Inherited from Object) MemberwiseClone()

Creates a shallow copy of the current Object.

(Inherited from Object) ToString()

Returns a string that represents the current object.

Язык в Windows Form

Изменить язык в TextBox в Windows Form application
Хочу изменить исходный язык при попадании в TextBox на другой, например на английский, а после.

Из языка C++ перевести на язык C# Wimdows Form
Из языка C++ перевести на язык C# Wimdows Form.Заранее благодарю. // ConsoleApplication2.cpp.

C# windows form
Разработать динамическую библиотеку, содержащую класс вычисления функций с помощью разложения в.

Windows Form
скажите пожалуйста. Я создал класс вопросов содержащий массив вопросов в Windows Form. Как теперь.

Решение

Заказываю контрольные, курсовые, дипломные и любые другие студенческие работы здесь или здесь.

Windows Form
Здравствуйте. Чем дальше в лес, тем толще партизаны. 1.Как сделать так, чтобы моя форма(решая.

2 окна в windows form
Помогите связать 2 окна в windows Form. В первом(главном) показано выполнение программы(а именно.

Подвисание windows form
Привет, проблема заключается в том, что при выполнении нескольких циклов с Get запросом и.

Клонирование Windows Form
Добрый день, такой вопрос, можно ли по нажатию кнопки создать клон формы с тем же функционалом

Input Language Класс

Определение

Предоставляет методы и поля для управления языком ввода. Provides methods and fields to manage the input language. Этот класс не наследуется. This class cannot be inherited.

Читайте также:  Astra linux антивирусный модуль

Примеры

В следующем примере кода возвращается список установленных языков. The following code example gets a list of installed languages. В этом примере требуется, textBox1 чтобы был создан экземпляр и textBox1.MultiLine для которого было задано значение true . The example requires that textBox1 has been instantiated and that textBox1.MultiLine has been set to true .

В следующем примере задается язык ввода по умолчанию как текущий язык ввода. The next example sets the default input language as the current input language. В этом примере требуется, textBox1 чтобы был создан экземпляр и textBox1.MultiLine для которого было задано значение true . The example requires that textBox1 has been instantiated and that textBox1.MultiLine has been set to true .

Комментарии

Язык ввода — это пара «Культура» или «раскладка клавиатуры», которая определяет, как физические ключи на карте клавиатуры или графике соответствуют символам языка. An input language is a culture/keyboard layout pair that determines how the physical keys on a keyboard map or plot to characters in a language. Язык ввода основан на идентификаторе языка ввода Windows, например, возвращенном функцией SDK платформы GetKeyboardLayout . The input language is based on a Windows input locale identifier, such as that returned by the Platform SDK function, GetKeyboardLayout . Идентификатор локали ввода также называется маркером для значения раскладки клавиатуры (HKL). The input locale identifier is also called a handle to a keyboard layout (HKL) value.

Используйте static методы, предоставленные для поиска всех установленных сопоставлений системы, и для изменения языка ввода для потока или процесса. Use the static methods provided to find all installed mappings of the system and to change the input language for a thread or process. Вызовите метод CurrentInputLanguage , чтобы получить текущий язык ввода. Call CurrentInputLanguage to get the current input language. Вызов DefaultInputLanguage для языка ввода по умолчанию. Call DefaultInputLanguage for the default input language. Вызовите InstalledInputLanguages , чтобы получить все установленные языки в этой системе. Call InstalledInputLanguages to get all the installed languages in this system. После создания списка всех установленных языков используйте CurrentInputLanguage для изменения текущего языка ввода на другой язык. After you have a list of all the installed languages, use CurrentInputLanguage to change the current input language to a different language.

Свойства

Получает язык и региональные параметры для текущего языка ввода. Gets the culture of the current input language.

Получает или задает язык ввода для текущего потока. Gets or sets the input language for the current thread.

Получает язык ввода, используемый в системе по умолчанию. Gets the default input language for the system.

Получает дескриптор для языка ввода. Gets the handle for the input language.

Читайте также:  Android подключение mac os

Получает список всех установленных языков ввода. Gets a list of all installed input languages.

Получает имя текущей раскладки клавиатуры в том виде, в каком оно отображается в региональных параметрах операционной системы компьютера. Gets the name of the current keyboard layout as it appears in the regional settings of the operating system on the computer.

Методы

Указывает, тождественны ли два языка ввода. Specifies whether two input languages are equal.

Возвращает язык ввода, связанный с указанным языком и региональными параметрами. Returns the input language associated with the specified culture.

Возвращает хэш-код данного языка ввода. Returns the hash code for this input language.

Возвращает объект Type для текущего экземпляра. Gets the Type of the current instance.

(Унаследовано от Object) MemberwiseClone()

Создает неполную копию текущего объекта Object. Creates a shallow copy of the current Object.

(Унаследовано от Object) ToString()

Возвращает строку, представляющую текущий объект. Returns a string that represents the current object.

How to make multi-language app in Winforms?

I have an application and I need to use two languages in that application. For example :

But I don’t know how could I do that. Anybody can help me for this?

I need some examples in C# Windows Forms .

3 Answers 3

Using Localizable and Language Property of Form

Form class have Localizable and Language Property. If you set Localizable property to true, you can add controls to form for default language and set properties for default language. Then you can select another languages and change properties for those languages. This way, value or localizable properties will store in separate resource files for different cultures.

Note: A property is considered as localizable if it’s decorated with [Localizable(true)] attribute. For example BackColor property is not localizable, but Text property is localizable.

Localizing Messages and Images using Resx Resource Files

The project has a Rseources.Resx file under Properties folder which you can use for localizing images and messages. Also you can add .resx Resource files to project. For example you can create a Strings.resx file and add some string key and values to it, then copy it as strings.en.resx and strings.fa.resx and edit values for those languages. Then you can use those resource values, For example:

Will show the value of AreYouSure from Resources.Resx file with the current UI culture language.

If a resource key not found for a culture or the specified culture not found for the resource file, value of the key in neutral culture of the Resx file will be used.

Change the language at Run-time

You can set the culture of a application to Persian using:

You should put the above code at start of your application or before showing a form.

Оцените статью