Category / Section
How to display an auto hide window that shows and hides automatically with animation in WinForms Docking Manager?
1 min read
Animation speed
Essential Tools supports this behavior using ActivateControl and HideAutoHiddenControl methods of DockingManager. For doing this it is necessary to set the DockingManager.AnimationStep to less than 5 to decrease the speed of animation. Please refer the below code snippet which illustrataes this.
C#
this.dockingManager1.SetEnableDocking(this.panel1, true); this.dockingManager1.DockControl(this.panel1, this, DockingStyle.Top, 700); //if you set this at initial stage, it will apply for rest of the application. DockingManager.AnimationStep = 5; this.dockingManager1.SetAutoHideMode(this.panel1, true); this.dockingManager1.SetDockLabel(this.panel1, "Dashboard"); this.dockingManager1.SetAutoHideButtonVisibility(this.panel1, false); this.dockingManager1.SetCloseButtonVisibility(this.panel1, false); private void Form1_Load(object sender, EventArgs e) { this.WindowState = FormWindowState.Maximized; this.dockingManager1.ActivateControl(this.panel1); } private void Form1_Click(object sender, EventArgs e) { dockingManager1.HideAutoHiddenControl(true); }
VB
Me.DockingManager1.SetEnableDocking(Me.Panel1, True) Me.DockingManager1.DockControl(Me.Panel1, Me, DockingStyle.Top, 700) 'if you set this at initial stage, it will apply for rest of the application. DockingManager.AnimationStep = 5 Me.DockingManager1.SetAutoHideMode(Me.Panel1, True) Me.DockingManager1.SetDockLabel(Me.Panel1, "Dashboard") Me.DockingManager1.SetAutoHideButtonVisibility(Me.Panel1, False) Me.DockingManager1.SetCloseButtonVisibility(Me.Panel1, False) Private Sub Form1_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load Me.WindowState = FormWindowState.Maximized Me.DockingManager1.ActivateControl(Me.Panel1) End Sub Private Sub Form1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Click DockingManager1.HideAutoHiddenControl(True) End Sub
UG document links: