 2007-10-26 15:20
	    2007-10-26 15:20
   2007-10-26 15:28
	    2007-10-26 15:28
  在keydown里面写 
if keycode=13 then  text2.setfocus
哪有这么简单?
是一系列文本框数组.15个,能每个都这样编么.
要在此过程中能完成的话,就简单多了.
Private Sub Text1_KeyPress(Index As Integer, KeyAscii As Integer)
End Sub
但我做不了.

 2007-10-26 16:53
	    2007-10-26 16:53
  你这个是控件数组了!
用 sendkeys "{tab}"也可以了!
Private Sub Text1_KeyPress(Index As Integer, KeyAscii As Integer) 
    if index<15 then
        if keyascii=13 then
            text1(index+1).setfocus
        end if
    end if
End Sub
自己灵活点了!

 2007-10-26 17:09
	    2007-10-26 17:09
  唉,这个问题,论坛上早就有过了,现在的新人,明显缺点就是懒惰.

 2007-10-26 17:15
	    2007-10-26 17:15
   2007-10-26 17:23
	    2007-10-26 17:23
  你这个是控件数组了!
用 sendkeys "{tab}"也可以了!
Private Sub Text1_KeyPress(Index As Integer, KeyAscii As Integer) 
    if index<15 then
        if keyascii=13 then
            text1(index+1).setfocus
        end if
    end if
End Sub
自己灵活点了!
这个方法我也试过了,只是没有外层的 if index<15 then
但效果是一样的.从第一个能跳到第二个,或从第三个能跳到四,五,六个.
接着就提示
"实时错误 5"
"无效的过程调用或参数".
不知怎么回事?

 2007-10-26 19:07
	    2007-10-26 19:07
   2007-10-26 20:16
	    2007-10-26 20:16
  Private Sub Text1_KeyDown(Index As Integer, KeyCode As Integer, Shift As Integer)
If KeyCode = 13 Then Text1(Index + 1).SetFocus
End Sub

 2007-10-26 22:35
	    2007-10-26 22:35
   2007-10-27 00:20
	    2007-10-27 00:20