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. Image for the cookie policy date

Multiple Monitors and XPMenus

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.

4 Replies

AD Administrator Syncfusion Team March 18, 2005 07:59 PM UTC

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.


JF Jeff Fansler March 22, 2005 06:03 PM UTC

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.


AD Administrator Syncfusion Team March 23, 2005 03:58 PM UTC

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.


JF Jeff Fansler March 23, 2005 05:29 PM UTC

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.

Loader.
Up arrow icon