We use cookies to give you the best experience on our website. If you continue to browse, then you agree to our privacy policy and cookie policy.
Unfortunately, activation email could not send to your email. Please try again.

How to change the context menu in the Tabbed MDI for forms?

Thread ID:

Created:

Updated:

Platform:

Replies:

100762 Sep 2,2011 01:06 PM Sep 11,2011 07:37 AM Windows Forms 5
loading
Tags: Tools
Administrator [Syncfusion]
Asked On September 2, 2011 01:06 PM


Hi,

I wish to add custom items to the child form's context menu. At the moment we only have "Close" option in the context menu which can be enabled/disabled by setting child form’s control box property.
Is there a way to add custom option to this context menu?

Best regards

Luojia Yang


Eugene Kozlov
Replied On September 5, 2011 05:50 AM

Here is a screenshot of the menu we want to change.
(see the red box)




screenShot_e1fbf28a.zip

Eugene Kozlov
Replied On September 5, 2011 05:51 AM

Here is a screenshot of the menu we want to change.
(see the red box)




screenShot_f038ec95.zip

Iniyen M A [Syncfusion]
Replied On September 5, 2011 07:21 AM

Hi Luojia / Eugene,

Thanks for your interest in Syncfusion products.

You can achieve your requirement by using the TabbedMDIManager's ContextMenuItem AddRange() method, For more information i have included the sample as follows.

[Sample]
http://www.syncfusion.com/uploads/redirect.aspx?&team=support&file=TabbedMDISamp-523518568.zip

Please have a look on the above sample and let us know if you need further assistance.

Regards,
Iniyen M.A.


Administrator [Syncfusion]
Replied On September 6, 2011 01:10 PM

Hi,

The described method works, however I also want to know how to add a event handler to the custom menu item?
Say I want to display a message box when click on the the newly added item in the example.

Thanks a lot.



Iniyen M A [Syncfusion]
Replied On September 11, 2011 07:37 AM

Hi Luojia,

Thanks for the update.

You can achieve your requirement by using the BarItems's Click Event. For more information in have included the Code snippet as follows.

[Code Snippet]
this.editItem.Click += new EventHandler(editItem_Click);
void editItem_Click(object sender, EventArgs e)
{
MessageBox.Show("Edit Menu Item Clicked !");
}

Please have a look on the following sample which holds the above code snippet and let us know if you need further assistance.

[Sample]
http://www.syncfusion.com/uploads/redirect.aspx?&team=support&file=TabbedMDISampMod-1566006682.zip

We are glad to help you out.

Regards,
Iniyen M.A.


CONFIRMATION

This post will be permanently deleted. Are you sure you want to continue?

Sorry, An error occured while processing your request. Please try again later.

You are using an outdated version of Internet Explorer that may not display all features of this and other websites. Upgrade to Internet Explorer 8 or newer for a better experience.

;