Posted to microsoft.public.excel.programming
|
|
PROBLEM: Keywords;= Userform, Class Modules, ButtonGroup and Nomenclature
Show the code that creates the buttons array, it may be re-usable.
--
HTH
RP
(remove nothere from the email address if mailing direct)
"Myles" wrote in
message ...
I have a Userform with 48 commanbuttons created on the fly via a
*ClassModule *named *BClass* and using Array holder *Btns()*.
As we would have it, it is possible to refer to any of the
CommandButtons (say the 15th button) as, by way of example, * Btns
(15).ButtonGroup.Caption *. But this is valid only when such reference
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 my
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 to
invoke -the caption of CommandButton15 -*from a Class Module*? the way
we would use * Btns (15).ButtonGroup.Caption * from a UserFrom module
or General module?
TIA
Myles
--
Myles
------------------------------------------------------------------------
Myles's Profile:
http://www.excelforum.com/member.php...o&userid=28746
View this thread: http://www.excelforum.com/showthread...hreadid=497315
|