资讯

精准传达 • 有效沟通

从品牌网站建设到网络营销策划,从策略到执行的一站式服务

vb点虐 屏蔽输入法 vbs弹出输入框

用VB禁用输入法帮助

你建立个 form1, 里面画个 Combo1,text1 text2 然后把这段代基兄码弄进去代码里敬败面,自己研究下,这个能帮助你解决问题了

公司主营业务:网站设计、做网站、移动网站开发等业务。帮助企业客户真正实现互联网宣传,提高企业的竞争能力。创新互联是一支青春激扬、勤奋敬业、活力青春激扬、勤奋敬业、活力澎湃、和谐高效的团队。公司秉承以“开放、自由、严谨、自律”为核心的企业文化,感谢他们对我们的高要求,感谢他们从不同领域给我们带来的挑战,让我们激情的团队有机会用头脑与智慧不断的给客户带来惊喜。创新互联推出铜鼓免费做网站回馈大家。

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.ListIndex + 1)

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

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.ListCount 亮锋颤 0 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点虐 或C#如何屏蔽整个键盘的输入?

做一个textbox,放在窗体外,anchor设成top,

right,不要设置visible属性和enabled属段伏锋性,要输入的握晌时候就textbox1.focus(),在textbox1的textchange事件里面画图

不好的地方在厅局于每一次输入都要先清空,你可以在图片框的背景哪里设置图片,在image里面绘制文字

it3241的办法比我的更慢就是了


文章题目:vb点虐 屏蔽输入法 vbs弹出输入框
URL网址:http://www.cdkjz.cn/article/ddpgsph.html
多年建站经验

多一份参考,总有益处

联系快上网,免费获得专属《策划方案》及报价

咨询相关问题或预约面谈,可以通过以下方式与我们联系

大客户专线   成都:13518219792   座机:028-86922220