[]
Gets or sets a value indicating the outer margin of a ControlBar window relative the owner form client coordinates.
public Padding Margin { get; set; }
Type | Description |
---|---|
Padding | A Padding value that represents the outer margin of the ControlBar window in pixels. The default is 0. |
This property only take effect when PositionMode property value is MultiTouch.PositionMode.Dock.
Following table shows which property will take effect when DockPosition different.
DockPosition | Margin |
---|---|
TopLeft | Top, Left |
TopCenter | Top |
TopRight | Top, Right |
MiddleLeft | Left |
MiddleCenter | not avaiable |
MiddleRight | Right |
BottomLeft | Bottom, Left |
BottomCenter | Bottom |
BottomRight | Bottom, Right |
The following code example shows how to use this property.
This code example is part of a larger example provided for the ControlBar class.
public class ControlBarDemo : Form
{
private MyUserControl _userControl = new MyUserControl();
private GcZoom _gcZoom1 = new GcZoom();
public ControlBarDemo()
{
_gcZoom1.Target = this;
// Create ControlBar
AddControlBar();
}
private void AddControlBar()
{
ControlBar controlBar = new ControlBar();
// Content should is a Type of UserControl.
controlBar.Content = _userControl.GetType();
controlBar.PositionMode = PositionMode.Floating;
// Only take effect when Position Mode is Dock.
controlBar.Margin = new System.Windows.Forms.Padding();
_gcZoom1.ControlBars.Add(controlBar);
}
}
Public Class ControlBarDemo
Inherits Form
Private _userControl As New MyUserControl()
Private _gcZoom1 As New GcZoom()
Public Sub New()
_gcZoom1.Target = Me
' Create ControlBar
AddControlBar()
End Sub
Private Sub AddControlBar()
Dim controlBar As New ControlBar()
' Content should is a Type of UserControl.
controlBar.Content = _userControl.[GetType]()
controlBar.PositionMode = PositionMode.Floating
' Only take effect when Position Mode is Dock.
controlBar.Margin = new System.Windows.Forms.Padding();
_gcZoom1.ControlBars.Add(controlBar)
End Sub
End Class