总是说我“B = Choose(A, "零", "壹", "贰", "叁", "肆", "伍", "陆", "柒", "捌", "玖")”有错,不太知道错在哪,望高手指点!!!Private Sub Text1_Change()Dim A%, B%A = Val(Text1.Text)Select Case ACase 0 To 9B = Choose(A, "零", "壹", "贰", "叁", "肆", "伍", "陆", "柒", "捌", "玖")Picture1.Print A & "→" & BCase ElsePicture1.Print "输入的不是数字字符"End SelectEnd Sub
1 回答
隔江千里
TA贡献1906条经验 获得超10个赞
Option Explicit
Private Sub Text1_Change()
Dim A As Integer, B As String
A = Val(Text1.Text)
Select Case A
Case 0 To 9
B = Choose(A + 1, "零", "壹", "贰", "叁", "肆", "伍", "陆", "柒", "捌", "玖")
Print A & "→" & B
Case Else
Print "输入的不是数字字符"
End Select
End Sub
你主要定义函数时错误及Choose使用错误.另外,不必要使用Picture控件.
Choose(index, choice-1[, choice-2, ... [, choice-n]])
index 必要参数,数值表达式或字段,它的运算结果是一个数值,且界于 1 和可选择的项目数之间。
choice 必要参数,Variant 表达式,包含可选择项目的其中之一。
添加回答
举报
0/150
提交
取消