vb.net屏蔽输入法 屏蔽微软输入法

vb.net屏蔽鼠标和键盘的问题VB.net可以调用DLL吗?如果可以vb.net屏蔽输入法的话,vb.net屏蔽输入法你用VB6.0编写一个DLL给VB.NET调用就行vb.net屏蔽输入法了
用VB禁用输入法帮助你建立个 form1,里面画个 Combo1 , text1text2 然后把这段代码弄进去代码里面,自己研究下,这个能帮助你解决问题了
Option Explicit
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 = H1
Dim la(1 To 16) As Long
Dim ActIme As Long
Private Sub Combo1_Click()
ActIme = la(Combo1.ListIndex1)
Debug.Print ActIme
Text1.SetFocus
End Sub
Private 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
【vb.net屏蔽输入法 屏蔽微软输入法】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 Sub
Private Sub Text1_GotFocus()
If Combo1.ListCount0 Then
ActivateKeyboardLayout ActIme, 1
End If
End Sub
VB窗体如何设置只允许输入英文 。因为我这里有快捷键 , 不允许中文输入法出现 。否则我就悲催了 。Option Explicit
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 = H1
Dim la(1 To 16) As Long
Dim ActIme As Long
Private Sub Timer1_Timer()
ActIme = "134481924" ’这里是英文输入法的码 。
ActivateKeyboardLayout ActIme, 1
End Sub
这些代码的意思是始终调用英文输入法 。设timer的Interval为200就可以了 。这些是vb代码 。程序关闭后就可以自己调用输入法了,也不用卸载其他的输入法 。
VB文本框如何禁止输入字母,算字和特殊符号Private Sub Text1_KeyPress(KeyAscii As Integer)
If KeyAscii48 Or KeyAscii57 Then
KeyAscii = 0
End If
End Sub 可以禁止输入字母
private sub text1_change()
if text1="" then exit sub
if not isletter(text1) then
msgbox "only a-z A-Z letters allowed"
end if
end sub 这个是禁止输入算字和特殊符号
vb.net如何屏蔽shift enterCnPack组件包中有KeyBlocker组件vb.net屏蔽输入法 , 可以键盘hookvb.net屏蔽输入法的方式屏蔽一些键vb.net屏蔽输入法,但对CTRL ALT DEL无效 。
例子在cnpack\Examples\KeyBlocker中 。
vb.net 或C#如何屏蔽整个键盘的输入?做一个textbox,放在窗体外 , anchor设成top,
right,不要设置visible属性和enabled属性 , 要输入的时候就textbox1.focus(),在textbox1的textchange事件里面画图
不好的地方在于每一次输入都要先清空,你可以在图片框的背景哪里设置图片,在image里面绘制文字
it3241的办法比我的更慢就是了
vb.net屏蔽输入法的介绍就聊到这里吧,感谢你花时间阅读本站内容,更多关于屏蔽微软输入法、vb.net屏蔽输入法的信息别忘了在本站进行查找喔 。

    推荐阅读