请告诉我如何在两个不同的文本框中使用两个语言? [英] please tell me how can use tow language in tow diffrent textbox?

查看:66
本文介绍了请告诉我如何在两个不同的文本框中使用两个语言?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我使用的是拖曳文本框,一种是engslih语言,另一种是泰语语言,它安装在我的计算机中,我使用以下波纹管代码,请参阅

i am using tow text boxes one is engslih language and other is thai language it is installed in my computer i use these bellow code please see

Public Class Form1
    'Constant for english language

    Private Const _ENGLISH As String = "ENGL"

    'Constant for thai language

    Private Const _THAI As String = "THAI"



''用于保留控件颜色的临时变量



''A Temporary variable to hold the color of a control

Private OriginalColor As Color
    Private Sub TextBox2_GotFocus(ByVal sender As Object, ByVal e As System.EventArgs) Handles TextBox2.GotFocus, TextBox1.GotFocus


''================================================= =========================

''第一部分-语言(切换)

''================================================ =========================

''我们将使用case语句检查发件人对象.Tag属性

选择案例发件人.标签


''===========================================================================

'' FIRST PART - LANGUAGE(SWITCHING)

''===========================================================================

''We''ll use the case statement to inspect the sender objects .Tag property

Select Case sender.Tag

Case _THAI
                'If the Tag contains the word "THAI"

                'Loop through all the installed languages on this System

                For Each Lng As InputLanguage In InputLanguage.InstalledInputLanguages

                    'If there exists a language whose DisplayName has got the 

                    'word "THAI" in it

                    If Lng.Culture.DisplayName.ToUpper.StartsWith(_THAI) Or Lng.Culture.DisplayName.ToUpper.StartsWith("CATA") Then

                        'Change current input language to that 

                        InputLanguage.CurrentInputLanguage = Lng

                        'Exit for - coz we have found our language and no need to 

                        'go through the rest of the loop

                        Exit For

                    End If

                Next

            Case _ENGLISH           'If the Tag contains the word "ENGL"

                'Loop through all the installed languages on this System

                For Each Lng As InputLanguage In InputLanguage.InstalledInputLanguages

                    'If there exists a language whose DisplayName has got the 

                    'word "ENGL" in it

                    If Lng.Culture.DisplayName.ToUpper.StartsWith(_ENGLISH) Then

                        'Change current input language to that 

                        InputLanguage.CurrentInputLanguage = Lng

                        'Exit for - coz we have found our language and no need to 

                        'go through the rest of the loop

                        Exit For

                    End If

                Next

        End Select
    End Sub
End Class




我使用它但不能更改语言,请告诉我如何使用这些设置
当我写一个文本框时以英语书写,当我写第二个文本框以英语书写时,请帮助我




i use it but it can not changes language please tell me how i can use these setting
when i write one text box so it should me in English and when i go in second text-box so it write Thai please help me

推荐答案

Custom Text box Control that Switch keyboard language Automatically[^]
New link added


这篇关于请告诉我如何在两个不同的文本框中使用两个语言?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆