demoSub main() Dim text As String, Data() As Long Dim i As Integertext = "ⅠⅡⅢⅣⅤⅥⅦⅧⅨⅩⅪⅫnnd咋这么难"ReDim Data(Len(text) - 1)For i = 0 To Len(text) - 1 Data(i) = AscW(Mid(text, i + 1, 1)) Next End Sub
下面的代码离你要解决的问题还有一段距离,仅供参考Private Sub Text1_KeyPress(KeyAscii As Integer) Select Case Chr(KeyAscii) Case "1" Me.Text1.SelText = "I" Case "2" Me.Text1.SelText = "II" Case "3" Me.Text1.SelText = "III" Case "4" Me.Text1.SelText = "IV" Case "5" Me.Text1.SelText = "V" Case "6" Me.Text1.SelText = "VI" Case "7" Me.Text1.SelText = "VII" Case "8" Me.Text1.SelText = "VIII" Case "9" Me.Text1.SelText = "IX" Case "0" Me.Text1.SelText = "O" Case Else Exit Sub End Select Me.Text1.SelStart = Me.Text1.SelStart + Len(Me.Text1.SelText) Me.Text1.SelLength = 0 KeyAscii = 0 End Sub
Private Sub Text1_KeyPress(KeyAscii As Integer) Select Case Chr(KeyAscii) Case "1" Me.Text1.SelText = "Ⅰ" Case "2" Me.Text1.SelText = "Ⅱ" Case "3" Me.Text1.SelText = "Ⅲ" Case "4" Me.Text1.SelText = "Ⅳ" Case "5" Me.Text1.SelText = "Ⅴ" Case "6" Me.Text1.SelText = "Ⅵ" Case "7" Me.Text1.SelText = "Ⅶ" Case "8" Me.Text1.SelText = "Ⅷ" Case "9" Me.Text1.SelText = "Ⅸ" Case "0" Me.Text1.SelText = "Ⅹ" Case Else Exit Sub End Select Me.Text1.SelStart = Me.Text1.SelStart + Len(Me.Text1.SelText) Me.Text1.SelLength = 0 KeyAscii = 0 End Sub我已经把字符串替换了,但仍然需要你把它完善了才可用
Dim text As String, Data() As Long
Dim i As Integertext = "ⅠⅡⅢⅣⅤⅥⅦⅧⅨⅩⅪⅫnnd咋这么难"ReDim Data(Len(text) - 1)For i = 0 To Len(text) - 1
Data(i) = AscW(Mid(text, i + 1, 1))
Next
End Sub
我现在是从word里选符号,然后粘贴到文本框中,但我不能要求客户也这样做啊
Select Case Chr(KeyAscii)
Case "1"
Me.Text1.SelText = "I"
Case "2"
Me.Text1.SelText = "II"
Case "3"
Me.Text1.SelText = "III"
Case "4"
Me.Text1.SelText = "IV"
Case "5"
Me.Text1.SelText = "V"
Case "6"
Me.Text1.SelText = "VI"
Case "7"
Me.Text1.SelText = "VII"
Case "8"
Me.Text1.SelText = "VIII"
Case "9"
Me.Text1.SelText = "IX"
Case "0"
Me.Text1.SelText = "O"
Case Else
Exit Sub
End Select
Me.Text1.SelStart = Me.Text1.SelStart + Len(Me.Text1.SelText)
Me.Text1.SelLength = 0
KeyAscii = 0
End Sub
我现在是从word里选符号,然后粘贴到文本框中,但我不能要求客户也这样做啊
===================================
中文输入法的软键盘都可以直接输入的ⅠⅡⅢⅣⅤⅥⅦⅧⅨⅩ
Select Case Chr(KeyAscii)
Case "1"
Me.Text1.SelText = "Ⅰ"
Case "2"
Me.Text1.SelText = "Ⅱ"
Case "3"
Me.Text1.SelText = "Ⅲ"
Case "4"
Me.Text1.SelText = "Ⅳ"
Case "5"
Me.Text1.SelText = "Ⅴ"
Case "6"
Me.Text1.SelText = "Ⅵ"
Case "7"
Me.Text1.SelText = "Ⅶ"
Case "8"
Me.Text1.SelText = "Ⅷ"
Case "9"
Me.Text1.SelText = "Ⅸ"
Case "0"
Me.Text1.SelText = "Ⅹ"
Case Else
Exit Sub
End Select
Me.Text1.SelStart = Me.Text1.SelStart + Len(Me.Text1.SelText)
Me.Text1.SelLength = 0
KeyAscii = 0
End Sub我已经把字符串替换了,但仍然需要你把它完善了才可用
我这样取文本框中每个字的内码Asc(Mid(Trim(txtQieQu.Text), j, 1)),j是循环的
但这样取出来的不对