设计触摸屏界面,如何用checkbox控件实现输入法的切换,
假设有1,2,3个选择项,选中1,为全拼输入法,选中2,为英文输入法,选中3,为五笔输入法??
感谢,感谢,!!信誉第一,一定给分!!!

解决方案 »

  1.   

    参考 http://www.itcnw.com/Article/Net/ordertools/200510/24863.htmlVB编程控制Windows中文输入法
      

  2.   

    Private Declare Function GetKeyboardLayoutList Lib "user32" (ByVal nBuff As Long, _
            lpList As Long) As Long
    Private Declare Function GetKeyboardLayoutName Lib "user32" Alias "GetKeyboardLayoutNameA" _
            (ByVal pwszKLID As String) As Long
    Private Declare Function GetKeyboardLayout Lib "user32" (ByVal dwLayout As Long) As Long
    Private Declare Function ImmGetDescription Lib "imm32.dll" Alias "ImmGetDescriptionA" (ByVal _
            hkl As Long, ByVal lpsz As String, ByVal uBufLen As Long) As Long
    Private Declare Function ActivateKeyboardLayout Lib "user32" (ByVal hkl As Long, ByVal _
            flags As Long) As Long
            
    Const IME_CONFIG_GENERAL = 1
    Const KLF_REORDER = &H8
    Const KLF_ACTIVATE = &H1Dim la(1 To 16) As Long
    Dim ActIme As LongPrivate Sub Combo1_Click()
        ActIme = la(Combo1.ListIndex + 1)
        Debug.Print ActIme
        Text1.SetFocus
    End SubPrivate Sub Form_Load()
        Dim astr As String * 256
        Dim bstr As String
        Dim x, hMem, i As Long
        
        x = GetKeyboardLayoutList(32, la(1))
        Combo1.Clear
        If x Then
            For i = 1 To x
                ImmGetDescription la(i), astr, 256
                If InStr(astr, Chr(0)) = 1 Then
                    bstr = ""
                Else
                    bstr = Left$(astr, InStr(astr, Chr(0)))
                End If
            
                If Trim(bstr) = "" Then
                    Combo1.AddItem "英语(美国)"
                Else
                    Combo1.AddItem bstr
                End If
            Next i
        End If
    End SubPrivate Sub Text1_GotFocus()
        If Combo1.ListCount > 0 Then
            ActivateKeyboardLayout ActIme, 1
        End If
    End Sub
      

  3.   

    checkbox?????楼主说的应该是optionbox吧。
      

  4.   

    如果只是切换中英文输入的话,你可以用文本框的IMEMode属性来控制。