# 用 For ... Next

Posted by Sephiroth on June 24, 1999 at 17:32:03:

In Reply to: 如何宣告阵列控制项变数 posted by rik on June 23, 1999 at 13:42:23:

: Text box : txt(0),txt(1),txt(2) 三个阵列控制项
: dim ctl as control
: set ctl=txt( ).....语法错误

: set ctl=txt(0) 一个一个宣告才可以

: 有没有何种宣告可以一次搞定

Dim i As Integer
Dim ctl() As Control

Redim ctl(LBound(txt) To UBound(txt))

For i = LBound(txt) To UBound(txt)
Set ctl(i) = txt(i)
Next

Follow Ups: