I refer to th eexample on p. 447, in which textboxes are subclassed. Code shows making a subclass instance for each textbox on the form manually. I.e.,
set FirstTB.myTextbox = Me.txtFirst 'i.e., the first textbox control
set LastTB.myTextbox = Me.txtLast
I would like to do this programmatically:
For each ObjCtl in Form.Controls
aTB = new clsTextbox
aTB.myTextbox = ObjCtl
next
Obviously, this code keeps reassigning to "aTB." What I'd like is:
i=0
For each ObjCtl in Form.Controls
i=i+1
aTB(i) = new clsTextbox
aTB(i).myTextbox = ObjCtl
next
But this is not how
VB works, I think. Any help appreciated.