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.

Multiple Monitors and XPMenus

Thread ID:

Created:

Updated:

Platform:

Replies:

26296 Mar 18,2005 02:20 PM Mar 23,2005 12:29 PM Windows Forms 4
loading
Tags: Tools
Jeff Fansler
Asked On March 18, 2005 02:20 PM

I''m having an issue with multiple monitors and using XPMenus. I often go back and forth between using multiple monitors and using a single monitor. The problem occurs when I design a toolbar using multiple monitors and the toolbars are on the secondary screen. If I then switch to a single monitor the toolbars are, I assume, still located on the secondary monitor. The effect is that I can not see the toolbars again unless I hook up to a secondary monitor. Is there anyway to move the floating toolbars back to the main screen when only one monitor is being used? Thanks for your help.

Administrator [Syncfusion]
Replied On March 18, 2005 02:59 PM

Hi Jeff, If you run the following code snippet, all your Bars will redock to the top of the your Form. foreach (Syncfusion.Windows.Forms.Tools.XPMenus.Bar b in this.mainFrameBarManager1.Bars) { this.mainFrameBarManager1.GetBarControl(b).DockState = Syncfusion.Windows.Forms.Tools.CommandBarDockState.Top; } Additionally, this can be easily modified to place the Bars wherever you want. Hope it helps. Regards, Gregory Austin Syncfusion Inc.

Jeff Fansler
Replied On March 22, 2005 01:03 PM

Hi Gregory, Your code would work well at run time. The problem I am having is at design time. Any ideas on how to solve that? Thanks, -Jeff >Hi Jeff, > > If you run the following code snippet, all your Bars will redock to the top of the your Form. > >foreach (Syncfusion.Windows.Forms.Tools.XPMenus.Bar b in this.mainFrameBarManager1.Bars) >{ > this.mainFrameBarManager1.GetBarControl(b).DockState = Syncfusion.Windows.Forms.Tools.CommandBarDockState.Top; >} > >Additionally, this can be easily modified to place the Bars wherever you want. > >Hope it helps. > >Regards, >Gregory Austin >Syncfusion Inc.

Administrator [Syncfusion]
Replied On March 23, 2005 10:58 AM

Hi Jeff, I''ve looked into this and haven''t been able to find any built-in method to redock the Bars, since all that information is in the BarControl. Overall, my suggestion would be to avoid designing the Bars on a second monitor. However, you can extend the MainFrameBarManager class to add that functionality, if you''re willing to trick VS .NET. You can wrap a method call in a designer attribute, and then modify that attribute to trigger the method. The following code snippet demonstrates this: public class BarManagerExt : Syncfusion.Windows.Forms.Tools.XPMenus.MainFrameBarManager { public BarManagerExt() : base() { } public BarManagerExt(System.ComponentModel.IContainer c, Form f) : base(c,f) { } public BarManagerExt(Form f) : base(f) { } [ CategoryAttribute("Functionality"), DescriptionAttribute("Redocks the Bars then returns to False") ] public bool NeedsRedock { get { return false; } set { if (value && this.DesignMode) { foreach (Syncfusion.Windows.Forms.Tools.XPMenus.Bar b in this.Bars) { this.GetBarControl(b).DockState = Syncfusion.Windows.Forms.Tools.CommandBarDockState.Top; } } } } } Regards, Gregory Austin Syncfusion Inc.

Jeff Fansler
Replied On March 23, 2005 12:29 PM

Thanks Gregory. >Hi Jeff, > > I''ve looked into this and haven''t been able to find any built-in method to redock the Bars, since all that information is in the BarControl. Overall, my suggestion would be to avoid designing the Bars on a second monitor. > >However, you can extend the MainFrameBarManager class to add that functionality, if you''re willing to trick VS .NET. You can wrap a method call in a designer attribute, and then modify that attribute to trigger the method. The following code snippet demonstrates this: > >public class BarManagerExt : Syncfusion.Windows.Forms.Tools.XPMenus.MainFrameBarManager > { > public BarManagerExt() : base() > { > } > > public BarManagerExt(System.ComponentModel.IContainer c, Form f) : base(c,f) > { > } > > public BarManagerExt(Form f) : base(f) > { > } > > [ > CategoryAttribute("Functionality"), > DescriptionAttribute("Redocks the Bars then returns to False") > ] > public bool NeedsRedock > { > get > { > return false; > } > set > { > if (value && this.DesignMode) > { > foreach (Syncfusion.Windows.Forms.Tools.XPMenus.Bar b in this.Bars) > { > this.GetBarControl(b).DockState = Syncfusion.Windows.Forms.Tools.CommandBarDockState.Top; > } > } > } > } > } > >Regards, >Gregory Austin >Syncfusion Inc.

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.

;