Change Keyboard Layout With Khmer Language

Hello in this post we will talking about how to create switching input language "KH" and " EN" Keyboard Layout.
let's start with my sample:

Create new Database :


And then create new Form ;


have 2 textbox
Now I create event "Enter" with these Textbox
and follow my Code:

Option Explicit
#If Win64 Then
'but it is support both
'Private Declare PtrSafe Function ActivateKeyboardLayout Lib "user32.dll" (ByVal mylanguage As Long, Flag As Boolean) As Long
#Else
    Private Declare Function ActivateKeyboardLayout Lib "user32.dll" (ByVal mylanguage As Long, Flag As Boolean) As Long
#End If
Private Const Kh = 1107 'khmer keyboard layout
Private Const CA = 1027 'khmer keyboard layout
Private Const Eng = 1033
Private Const Jap = 1041

Private Sub txteng_Enter()
    Call ActivateKeyboardLayout(Eng, True)
End Sub

Private Sub txtjap_Enter()
    Call ActivateKeyboardLayout(Jap, True)
End Sub

Private Sub txtkh_Enter()       ' khmer keyboard leyout
    Call ActivateKeyboardLayout(Kh, True)
End Sub



No comments

Powered by Blogger.