参数引用调用无效,问为什么
部分代码如下:
Private Sub txtMain_KeyPress(KeyAscii As Integer)
MakeUsable (KeyAscii)
RaiseEvent KeyPress(KeyAscii)
End Sub
Private Sub MakeUsable(word As Integer)
If (word >= 48 And word <= 57) Then
If (m_InputType <> Letters) = False Then word = 0
ElseIf (word >= 97 And word <= 122) Then
If (m_InputType = Letters And m_CaseType <> UpperCase _
Or m_InputType = AllInput And m_CaseType = LowerCase) = False Then word = 0
ElseIf (word >= 65 And word <= 90) Then
If (m_InputType = Letters And m_CaseType <> LowerCase _
Or m_InputType = AllInput And m_CaseType = UpperCase) = False Then word = 0
Else
word = 0
End If
End Sub
目的是使得输入的字符必须是满足要求的,否则置为空,但是引用调用的时候虽然word能够置0,但是并没有影响到KeyAscii的值,这是为什么?小弟初来乍到,多多关照。