-
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, "Current input method"
end sub
function getlayout() as string
dim buff as long
getlayout = "English input method"
buff = getkeyboardlayout(0) 'Get the current input method.
if immisime(buff) = 1 then 'Chinese input method.
getlayout = space(255)
immgetdescription buff, getlayout, len(getlayout)
end if
end function
To activate an input method, you can use activatekeyboardlayout
-
The input method monitors the reason why it's not VB, you can't use the label control.
-
Please check the input method.
2.Please check the font settings of the text box.
-
Install the sp6 patch.
Set the system time zone to China.
Set the default input method to Chinese input method.
Try all 3 of them and there will always be one that will solve your problem.
-
Check the handling of the keypress event, it may be that the double-byte character has been split.
-
Cycle + sleep, control the cycle with some conditions, and strive for a high efficiency
Embedding the compilation in the vb is a good note.
There will be many methods, and other methods are based on discrete mathematics, I hope the landlord will think twice!
-
Make another text box and set the visible property to. f.(Invisible), which records the text entered for the first time.
-
Make use of functions or compare them one by one...
-
private sub command1_click()if len(text1) <20 thenmsgbox "Only 20 digits can be entered"
elseif left(text1, 3) <159 and left(text1, 3) <753 then
msgbox "The first digit must be 159 or 753, please re-enter it"
end if
end sub
private sub text1_keypress(keyascii as integer)
if instr("0123456789", chr(keyascii)) = 0 then
msgbox "False, only Arabic numerals from 0-9 can be entered"
keyascii = 0
end if
end sub
-
Judge with if then specific usage to ask Du Niang.
It's pretty big, but if you're a beginner, it's nothing, and it's going to change quickly at the beginning.