Back to Devexpress

DockPanel.MakeFloat() Method

windowsforms-devexpress-dot-xtrabars-dot-docking-dot-dockpanel-aca9b660.md

latest3.9 KB
Original Source

DockPanel.MakeFloat() Method

Floats the current dock panel.

Namespace : DevExpress.XtraBars.Docking

Assembly : DevExpress.XtraBars.v25.2.dll

NuGet Package : DevExpress.Win.Navigation

Declaration

csharp
public void MakeFloat()
vb
Public Sub MakeFloat

Remarks

Use the MakeFloat method to float the panel that this method is called for. A docked panel will float at the coordinates specified by the panel’s docking position. To display a panel at a specific position, use the overload of the DockPanel.MakeFloat method which takes a Point parameter.

To simulate the floating state the MakeFloat method creates a floating form and this will contain the panel being made to float. The created floating form can be accessed via the panel’s DockPanel.FloatForm property. The DockPanel.FloatForm property can be useful, for instance, to change the position and size of the floating panel. If the panel isn’t floating the DockPanel.FloatForm property returns null.

Note

Do not change the panel’s DockPanel.Visibility property or call the MakeFloat method in the form’s constructor. Use the DockManager.Load event for this purpose.

Note

When implementing tooltips using the standard System.Windows.Forms.ToolTip class, take note that the tooltips will not be displayed for controls that reside within floating dock panels. To provide tooltips for controls, use the DefaultToolTipController or ToolTipController component instead. See Hints and Tooltips to learn more.

Example

In the following example a new panel is created and floated in the bottom right corner of the screen.

csharp
using DevExpress.XtraBars.Docking;
// ...
// Create a panel and make it floated.
DockPanel p1 = dockManager1.AddPanel(DockingStyle.Float);
p1.Text = "Panel 1";
// ...
p1.FloatSize = new Size(100, 150);
Point pt = new Point(Screen.PrimaryScreen.WorkingArea.Width - p1.Width, 
  Screen.PrimaryScreen.WorkingArea.Height - p1.Height);
// Move the panel to the bottom right corner of the screen.
p1.MakeFloat(pt);
vb
Imports DevExpress.XtraBars.Docking
' ...
' Create a panel and make it floated.
Dim p1 As DockPanel = DockManager1.AddPanel(DockingStyle.Float)
p1.Text = "Panel 1"
' ...
p1.FloatSize = New Size(100, 150)
Dim pt As Point = New Point(Screen.PrimaryScreen.WorkingArea.Width - p1.Width, _
  Screen.PrimaryScreen.WorkingArea.Height - p1.Height)
' Move the panel to the bottom right corner of the screen.
p1.MakeFloat(pt)

See Also

Restore()

FloatForm

Visibility

RootPanels

DockPanel Class

DockPanel Members

DevExpress.XtraBars.Docking Namespace