-
private declare function immgetdescription lib "" _
alias "immgetdescriptiona" (byval hkl as long, _
byval lpsz as string, byval ubuflen as long) as long
private declare function immisime lib "" (byval hkl as long) as long
private declare function activatekeyboardlayout lib "user32" _
byval hkl as long, byval flags as long) as long
private declare function getkeyboardlayout lib "user32" (byval dwlayout as long) as long
private sub form_load()
msgbox getlayout, vbinformation, "電流輸入法"
end sub
function getlayout() as string
dim buff as long
getlayout = "英文輸入法"
buff = getkeyboardlayout(0) '獲取當前輸入法。
if immisime(buff) = 1 then '中文輸入法。
getlayout = space(255)
immgetdescription buff, getlayout, len(getlayout)
end if
end function
要啟用輸入法,您可以使用 activatekeyboardlayout
-
輸入法監視它不是 VB 的原因,你不能使用標籤控制項。
-
請檢查輸入法。
2.請檢查文字框的字型設定。
-
安裝 sp6 修補程式。
將系統時區設定為中國。
將預設輸入法設定為中文輸入法。
嘗試所有 3 個,總會有乙個可以解決您的問題。
-
檢查按鍵事件的處理,可能是雙位元組字元被拆分了。
-
迴圈+休眠,在一定條件下控制迴圈,力求高效
將編譯嵌入到 vb 中是乙個很好的說明。
會有很多方法,其他方法都是基於離散數學的,希望房東三思而後行!
-
建立另乙個文字框並將 visible 屬性設定為。 f.(不可見),記錄首次輸入的文字。
-
利用函式或逐個比較它們......
-
private sub command1_click()if len(text1) <20 thenmsgbox "只能輸入 20 位數字"
elseif left(text1, 3) <159 and left(text1, 3) <753 then
msgbox "第一位數字必須是 159 或 753,請重新輸入"
end if
end sub
private sub text1_keypress(keyascii as integer)
if instr("0123456789", chr(keyascii)) = 0 then
msgbox "False,只能輸入 0-9 之間的阿拉伯數字"
keyascii = 0
end if
end sub
-
判斷用如果然後具體用法去問杜娘。