タイトル : Re: テキストの文字入力を半角英数またはカタカナに制限 投稿日 : 2008/04/09(Wed) 12:11 投稿者 : aaa
全角・半角かを判断するところに追加すればできました。 Private Function Bytechk(Value As String) As Boolean Dim LetterCount As Long '文字列の文字数 Dim ByteCount As Long '文字列のバイト数 LetterCount = Len(Value) '入力文字数 ByteCount = LenB(StrConv(Value, vbFromUnicode)) '入力文字のバイト数 If LetterCount <> ByteCount Then '全角ならば txtSendName.IMEMode = imIMEKatakanaSBCS '半角カタカナ入力に指定 txtSendName.Text = "" End If End Function。 |