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.

Determine if BarItem is shown and its Bar

Thread ID:

Created:

Updated:

Platform:

Replies:

43960 May 9,2006 03:47 PM May 23,2006 11:18 AM Windows Forms 5
loading
Tags: Tools
Administrator [Syncfusion]
Asked On May 9, 2006 03:47 PM

Is there a way to determine if a BarItem on a Bar has been turned off (hidden?) via the Quick Customize menu? When I check the BarItem''s Visible property it is always true even when I turn the item off with the Quick Customize menu.

J.Nagarajan [Syncfusion]
Replied On May 10, 2006 01:07 PM

Hi Don, I have tested this issue and it seems to be a bug in menus. I have logged a bug report # 2058 in this regard. You can track the progress of this issue at this link below : Defect #2058 - Visible property of BarItem always returns true after unchecking the BarItem with Quick Customize menu. Thanks for bringing this issue to our attention. We will fix this issue at the earliest and keep you informed. Thank you, J.Nagaraj

Administrator [Syncfusion]
Replied On May 10, 2006 02:42 PM

Thanks. I figured the .Visible property may always be true because the manager doesn''t really use it. A BarItem can be on multiple bars (in this case, a menu and a tool bar), just because it is turned off on the toolbar via QuickCustomize doesn''t turn it off in the menu. I thought maybe this information was tracked by the bar itself but I can''t figure out how. Thanks again.

Mano J [Syncfusion]
Replied On May 11, 2006 11:41 AM

Hi Don, Thanks for the information. You can get the BarItem which is hidden using the Quick Customize Menu by deriving a customBarManager from MainFrameBarManager and override SetUserVisibilityPreferenceInBar method, which gets triggered when a BarItem is hidden using "Add or Remove Buttons" context menu. public class CustomBarManager : MainFrameBarManager { public override void SetUserVisibilityPreferenceInBar (BarItem barItem, Bar bar, bool showOrHide) { if (!showOrHide) { Console.WriteLine(barItem.Text); } base.SetUserVisibilityPreferenceInBar(barItem, bar, showOrHide); } } Please let me know if this helps you. Regards, Mano sample.zip

Administrator [Syncfusion]
Replied On May 12, 2006 07:22 PM

Thanks for the reply. This gets me part of what I need. Is there a way to duplicate the QuickCustomize hiding of BarItems in code?

Mano J [Syncfusion]
Replied On May 23, 2006 11:18 AM

Hi Don, Sorry for this late reply. You can directly use MainFrameBarManager''s SetUserVisibilityPreferenceInBar method to show/hide BarItems in a bar through code. this.mainFrameBarManager1.SetUserVisibilityPreferenceInBar(this.barItem4, this.bar2, false); Please let me know if this helps you. 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.

;