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.

Show/hide XPMenus ParentBarItem

Thread ID:

Created:

Updated:

Platform:

Replies:

41161 Feb 23,2006 10:18 AM Feb 27,2006 07:46 AM Windows Forms 3
loading
Tags: Tools
Peter Moss
Asked On February 23, 2006 10:18 AM

I am trying to programatically show/hide a top-level ParentBarItem in an XPMenus MDI application. Initially, I want the menu item to be hidden. I added a ParentBarItem to both the main Form and the MDI child Form menus. By invoking a command, I programatically do this in the main Form: ParentBarItem mi = mainFrameBarManager.GetMergedEquivalent(miExtras, miExtras); bool bVisible = mi.Visible; mi.Visible = !bVisible; Nothing ever happens. I never see the miExtras become visible. I can see that the Visible property toggles from true/false, but there is no visible change in the Form. It doesn''t matter if a child Form is visible or not. Same behavior. Any ideas on how to make this happen?

Mano J [Syncfusion]
Replied On February 24, 2006 12:02 AM

Hi Pete, Thanks for using Essential Tools. I have tested this issue here. I am afraid, the code that you have used works fine. It correctly toggles the parentBarItem visiblity. I have attached the tested sample. In the sample, you can toggle the visibility using a checkbox. Please refer to it and let me know if I have missed anything. Regards, Mano Test_menus_forum.zip

Peter Moss
Replied On February 24, 2006 12:59 PM

Mano, Thanks for the reply. In parallel, I was starting to put together a sample app to test this. I came to the same conclusion that you did. In the simple app, it works just fine. So I had to go back to our real app and puzzle it out some more. I think I found out what the issue was. Our base class Form is in 1 assembly. I added the Extras menu there. But the final instance of this is a subclassed Form implemented in another assembly. When I brought that Form up in the designer, I saw that the menu I added was not visible. I had to manually add it. This added a new entry in the barMainMenu.UpdatedBarItemPositions array. To be honest, I''m not sure why I should have to do this in the subclassed Form when I added it as a protected item in the base class. But after I did this, the original code worked as you say. Can you explain the need to do this in the subclassed Form? Anyway, thank you for the help. Pete >Hi Pete, > >Thanks for using Essential Tools. > >I have tested this issue here. I am afraid, the code that you have used works fine. It correctly toggles the parentBarItem visiblity. I have attached the tested sample. In the sample, you can toggle the visibility using a checkbox. > >Please refer to it and let me know if I have missed anything. > >Regards, >Mano > >Test_menus_forum.zip >

Mano J [Syncfusion]
Replied On February 27, 2006 07:46 AM

Hi Pete, Please refer to the link below that explains the need to make XPMenus protected or public while inherting it. The corresponding components like the BarManager and toolbar should however be protected or public for this visual inheritance to be supported. http://www.syncfusion.com/library/menuswindows/visualinheritancesupport.html Please let me know if you have any questions. Thank you for using Syncfusion products. Regards, Mano

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.

;