L
Luis D Rojas
Hi,
i´ve added a new button to the menu bar in OL2003 and also i added a event
handler to that button like this:
_NewMenu = ( CommandBarPopup )_MainMenu.Controls["&New"];
_Button = ( CommandBarButton ) _NewMenu.Controls.Add(
MsoControlType.msoControlButton,_Missing, _Missing, _Missing, true );
_Button.Caption = "Apply Smart Plan";
_Button.Style = MsoButtonStyle.msoButtonIconAndCaption;
_Button.FaceId = 607;
_Button.BeginGroup = true;
_Button.Click +=new _CommandBarButtonEvents_ClickEventHandler(_Button_Click);
Then i open a new winform from this event like this
public void _Button_Click(Microsoft.Office.Core.CommandBarButton
barButton, ref bool Cancel)
{
View_EditSmartPlans splans = new View_EditSmartPlans();
splans.Show();
}
The problem that i have is that the event only works well once. I mean, the
first time OL is up, it executes calling the form, but if i close that form
and i try to click again to call the form, the event is fire.
Any suggestion about the reason of that?
best Regards
i´ve added a new button to the menu bar in OL2003 and also i added a event
handler to that button like this:
_NewMenu = ( CommandBarPopup )_MainMenu.Controls["&New"];
_Button = ( CommandBarButton ) _NewMenu.Controls.Add(
MsoControlType.msoControlButton,_Missing, _Missing, _Missing, true );
_Button.Caption = "Apply Smart Plan";
_Button.Style = MsoButtonStyle.msoButtonIconAndCaption;
_Button.FaceId = 607;
_Button.BeginGroup = true;
_Button.Click +=new _CommandBarButtonEvents_ClickEventHandler(_Button_Click);
Then i open a new winform from this event like this
public void _Button_Click(Microsoft.Office.Core.CommandBarButton
barButton, ref bool Cancel)
{
View_EditSmartPlans splans = new View_EditSmartPlans();
splans.Show();
}
The problem that i have is that the event only works well once. I mean, the
first time OL is up, it executes calling the form, but if i close that form
and i try to click again to call the form, the event is fire.
Any suggestion about the reason of that?
best Regards