error adding event handler.

Add-in Express™ Support Service
That's what is more important than anything else

error adding event handler.
 
tarz me




Posts: 7
Joined: 2007-03-28
Hi,

I think I am missing something small.
I created an Item in Standard Bar than I added 2 subbuttons,.

CommandBarPopup popup = (CommandBarPopup)cmdBarControl;
CommandBar bar = popup.CommandBar;


//1
cmdBarControl = bar.Controls.Add(MsoControlType.msoControlButton,1,"",1,true);
cmdBarControl.Caption="subbutton1";

//2
cmdBarControl = bar.Controls.Add(MsoControlType.msoControlButton,1,"",2,true);
cmdBarControl.Caption="subbutton2";


and I have an event handler that executes when subbutton is selected. And only second subbutton works..

I believe the second one is overeriting the first one.

event handler
--------------
CommandBarButton button = (CommandBarButton)cmdBarControl;
button.Click+= new _CommandBarButtonEvents_ClickEventHandler(button_Click);


//How do I make both subfolders work..

Thank you
Posted 29 Mar, 2007 15:51:51 Top
tarz me




Posts: 7
Joined: 2007-03-28
oopss.. forgot to subscribe an event to the first button :D
Nevermind :)
10X.

Posted 29 Mar, 2007 16:51:14 Top
Sergey Grischenko


Add-in Express team


Posts: 7233
Joined: 2004-07-05
Hi Tarz.

Please look the following example:
http://www.add-in-express.com/projects/oldynamiccontrolsexample-vs2005.zip
It shows on how you can create custom controls manually in the add-in code.



P.S. Note that we take up your forum requests in the order we receive them. Besides, it may take us some time to investigate your issue. Please be sure we will let you know as soon as the best possible solution is found.
Posted 30 Mar, 2007 08:48:25 Top