M
Myles
I have a Userform with 48 commanbuttons created on the fly via
*ClassModule *named *BClass* and using Array holder *Btns()*.
As we would have it, it is possible to refer to any of th
CommandButtons (say the 15th button) as, by way of example, * Btn
(15).ButtonGroup.Caption *. But this is valid only when such referenc
is made from a *UserForm Module *or *General Module*.
When it is used in a Class Module, * Btns (15).ButtonGroup.Caption
fails, as does, *BClass.Btns(15).ButtonGroup.Caption*. In m
frustration, I have had to get by using a long-winded approach as:
For each ctl in UserForm1.Controls
If TypeOf ctl Is MsForms.CommandButton then
If ctl.Width =60 Then 'optional line
If ct.name ="CommandButton15"
Msgbox *ctl.Caption*
End if
End if
End if
Next
Now, going by the example, what *nomenclature* can be employed t
invoke -the caption of CommandButton15 -*from a Class Module*? the wa
we would use * Btns (15).ButtonGroup.Caption * from a UserFrom modul
or General module?
TIA
Myle
*ClassModule *named *BClass* and using Array holder *Btns()*.
As we would have it, it is possible to refer to any of th
CommandButtons (say the 15th button) as, by way of example, * Btn
(15).ButtonGroup.Caption *. But this is valid only when such referenc
is made from a *UserForm Module *or *General Module*.
When it is used in a Class Module, * Btns (15).ButtonGroup.Caption
fails, as does, *BClass.Btns(15).ButtonGroup.Caption*. In m
frustration, I have had to get by using a long-winded approach as:
For each ctl in UserForm1.Controls
If TypeOf ctl Is MsForms.CommandButton then
If ctl.Width =60 Then 'optional line
If ct.name ="CommandButton15"
Msgbox *ctl.Caption*
End if
End if
End if
Next
Now, going by the example, what *nomenclature* can be employed t
invoke -the caption of CommandButton15 -*from a Class Module*? the wa
we would use * Btns (15).ButtonGroup.Caption * from a UserFrom modul
or General module?
TIA
Myle