变量未定义:
Private Sub Text47_Change()
If KeyCode = vbKeyReturn Then
Text48.SetFocus
End If
End Sub
工程运行到KEYCODE时提示:
编义错误
变量未定义
在线等待!急!
问题点数:50、回复次数:9Top
1 楼tony_jian(晕了)回复于 2002-05-15 09:11:16 得分 0
If KeyAscii = 13 Then
Text48.SetFocus
End If
Top
2 楼liuzhanwen(研究一下!)回复于 2002-05-15 09:22:59 得分 0
If KeyAscii = 13 Then
Text48.SetFocus
End IfTop
3 楼luosidao(螺丝刀)回复于 2002-05-15 09:23:47 得分 0
我写的代码也没有错啊!Top
4 楼dyx(天火)回复于 2002-05-15 09:24:21 得分 0
同上Top
5 楼luosidao(螺丝刀)回复于 2002-05-15 09:32:07 得分 0
If KeyAscii = 13 Then
Text48.SetFocus
End If
运行到KEYASCII时
还是提示变量未定义!
请大家帮帮忙!Top
6 楼dyx(天火)回复于 2002-05-15 09:33:53 得分 20
Private Sub Text47_KeyPress(Index As Integer, KeyAscii As Integer)
If KeyAscii = vbKeyReturn Then
Text48.SetFocus
End If
End SubTop
7 楼jyu1221(天同)回复于 2002-05-15 09:36:27 得分 20
Private Sub Text47_Change()
If KeyCode = vbKeyReturn Then
Text48.SetFocus
End If
End Sub
-----------------------------------------------
在Change中是不能访问KeyCode的,
只能在
Private Sub Text1_KeyDown(KeyCode As Integer, Shift As Integer)
End Sub
这里访问KeyCode这个变量
Top
8 楼footballboy(郑创斌)回复于 2002-05-15 10:10:13 得分 10
你可能是设计时双击Text47打开吧,一般打开的是Text47_Change事件处理过程,根据你想实现的功能看,应该用Text47_KeyPress才对,注意到没有Text47_Change过程是没有参数的,Text47_KeyDown带有参数KeyAscii
Private Sub Text47_KeyPress(KeyAscii As Integer)
If KeyAscii = vbKeyReturn Then
Text48.SetFocus
End If
End Sub
Top
9 楼gaoqi5037(高岐)回复于 2002-05-15 10:30:33 得分 0
气死!Top




