FAQ
I have the following function which creates buttons on Excel
commandbar. The problem i can't get the buttons to hook up to events.
For example, if i create four buttons only the fourth one fires the
ButtonEvent, the rest do nothing. What am i doing wrong.

Please help

Eric
--------------begin Function--------------------------
def CreateButton(self,menubar,buttons,images,captions, tooltips):
"""Create buttons on the Excel bar"""

if menubar is not None:
if buttons is not None:
i=0
for button in buttons:
button =
menubar.Controls.Add(Type=constants.msoControlButton,
Parameter="Greetings")
button=self.toolbarButton=
DispatchWithEvents(button, ButtonEvent)
button.BeginGroup = True
button.Width = "34"
if captions:
button.Caption =captions[i]
if tooltips:
button.TooltipText = tooltips[i]
i+=1
----------------------end Function------------------------------

Search Discussions

Related Discussions

Discussion Navigation
viewthread | post
Discussion Overview
grouppython-list @
categoriespython
postedAug 21, '03 at 2:53p
activeAug 21, '03 at 2:53p
posts1
users1
websitepython.org

1 user in discussion

Eric: 1 post

People

Translate

site design / logo © 2022 Grokbase