Hello, I'm using UltraToolbarManager and Office2013 style in .isl file for it, UltraToolbarManager is attached to UltraToolbarsDockArea as a top panel. Whenever I'm disabling my top panel I'm blocking caption buttons (close, minimize, restore). I want to block top panel while app is performing some operation but I would like to leave those caption buttons for user. I notice that when I set useAppStyle flague on true those caption buttons lays under ControlUIElement to which I don't have access during disabling control. Is there any solution to prevent disabling caption buttons ?
Hello and thank you for contacting Infragistics. Please attach a sample project demonstrating the behavior.
That's my form private Infragistics.Win.UltraWinToolbars.UltraToolbarsManager ultraToolbarsManager; private Infragistics.Win.UltraWinDock.UltraDockManager ultraDockManager; private Infragistics.Win.UltraWinToolbars.UltraToolbarsDockArea ultraDockAreaTop; private Infragistics.Win.Misc.UltraButton ultraButton2;Init:
private void InitializeComponent() { this.SuspendLayout(); // // Form1 // this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F); this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font; this.ClientSize = new System.Drawing.Size(1111, 450); this.Name = "Form1"; this.Text = "Form1";
this.ultraDockManager = new Infragistics.Win.UltraWinDock.UltraDockManager(this.components); this.ultraToolbarsManager = new Infragistics.Win.UltraWinToolbars.UltraToolbarsManager(this.components); this.ultraDockAreaTop = new Infragistics.Win.UltraWinToolbars.UltraToolbarsDockArea(); this.ultraButton2 = new Infragistics.Win.Misc.UltraButton();
this.ultraToolbarsManager.DesignerFlags = 1; this.ultraToolbarsManager.DockWithinContainer = this; this.ultraToolbarsManager.DockWithinContainerBaseType = typeof(System.Windows.Forms.Form); this.ultraToolbarsManager.FormDisplayStyle = Infragistics.Win.UltraWinToolbars.FormDisplayStyle.StandardWithRibbon; this.ultraToolbarsManager.Office2007UICompatibility = false;
this.ultraDockAreaTop.DockedPosition = Infragistics.Win.UltraWinToolbars.DockedPosition.Top; this.ultraDockAreaTop.Name = "top_area"; this.ultraDockAreaTop.ToolbarsManager = this.ultraToolbarsManager;
this.ultraToolbarsManager.Style = Infragistics.Win.UltraWinToolbars.ToolbarStyle.Office2013; this.ultraButton2.Location = new System.Drawing.Point(394, 209); this.ultraButton2.Name = "ultraButton2"; this.ultraButton2.Size = new System.Drawing.Size(75, 23); this.ultraButton2.TabIndex = 3; this.ultraButton2.Text = "ultraButton2";
this.Controls.Add(this.ultraDockAreaTop); ultraButton2.Click += DisableAll; this.Controls.Add(this.ultraButton2); this.ResumeLayout(false);
}
and disabling function
private void DisableAll(object sender, System.EventArgs e) {
this.ultraDockAreaTop.Enabled = false;
}Thanks for help
Hello,
I recommend disabling the controls that are docked rather than the portions of the DockManager, that way you can still dock other controls to that area. If you want to prevent certain controls from docking to specific areas you can hook the BeforeDockChange event and mark e.Cancel = true for said control and check its NewDockedLocation. See example below.
There is no UI for the end user to disable an entire pane so we don't make that accessible in code in the way you are expecting to disable an entire dock area.
WindowsFormsApp4 (2).zip
I thought about disbling those caption buttons because when I use Office2013 style with this propertyInfragistics.Win.UltraWinToolbars.FormDisplayStyle.StandardWithRibbon and I will dock ultraDockAreaTop on top with a binded toolbarsManager whenever I disable ultraDockAreaTop I'm getting also caption buttons disabled. Under ultraDockAreaTop I have a controls which needs to be disabled but I also turn off what I don't want. Is there any workaround to get this approach ?
I have to wonder if MDI forms would be better suited. You should probably undock and or hide components that you don't want to see rather than disable them.