本文整理汇总了C#中DockStyle类的典型用法代码示例。如果您正苦于以下问题:C# DockStyle类的具体用法?C# DockStyle怎么用?C# DockStyle使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。
DockStyle类属于命名空间,在下文中一共展示了DockStyle类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: DockablePanel
/// <summary>
/// Initializes a new instance of the <see cref="DockablePanel"/> class.
/// </summary>
/// <param name="key">The key.</param>
/// <param name="caption">The caption.</param>
/// <param name="innerControl">The inner control.</param>
/// <param name="dock">The dock.</param>
public DockablePanel(string key, string caption, Control innerControl, DockStyle dock)
{
this.Dock = dock;
this.Key = key;
this.InnerControl = innerControl;
this.Caption = caption;
}
示例2: DrawTab
public override void DrawTab(Color foreColor, Color backColor, Color highlightColor, Color shadowColor, Color borderColor, bool active, bool mouseOver, DockStyle dock, Graphics graphics, SizeF tabSize)
{
RectangleF headerRect = new RectangleF(0, 0, tabSize.Width, tabSize.Height);
Rectangle header = new Rectangle(0, 0, (int)tabSize.Width, (int)tabSize.Height);
using (var path = ShapeRender.GetTopRoundRect(0, 0, tabSize.Width, tabSize.Height, 0.5f))
{
if (active)
{
using (Brush brush = new SolidBrush(foreColor))
using (Pen pen = new Pen(shadowColor, 0.2f))
{
graphics.FillPath(brush, path);
graphics.DrawRectangle(pen, header);
}
}
else
{
using (Brush brush = new SolidBrush(backColor))
using (Pen pen = new Pen(shadowColor))
{
graphics.FillPath(brush, path);
}
}
}
}
示例3: DockTo
public void DockTo(DockPane pane, DockStyle dockStyle, int contentIndex)
{
if (dockStyle == DockStyle.Fill)
{
for (int i = NestedPanes.Count - 1; i >= 0; i--)
{
DockPane paneFrom = NestedPanes[i];
for (int j = paneFrom.Contents.Count - 1; j >= 0; j--)
{
IDockContent c = paneFrom.Contents[j];
c.DockHandler.Pane = pane;
if (contentIndex != -1)
pane.SetContentIndex(c, contentIndex);
c.DockHandler.Activate();
}
}
}
else
{
DockAlignment alignment = DockAlignment.Left;
if (dockStyle == DockStyle.Left)
alignment = DockAlignment.Left;
else if (dockStyle == DockStyle.Right)
alignment = DockAlignment.Right;
else if (dockStyle == DockStyle.Top)
alignment = DockAlignment.Top;
else if (dockStyle == DockStyle.Bottom)
alignment = DockAlignment.Bottom;
MergeNestedPanes(VisibleNestedPanes, pane.NestedPanesContainer.NestedPanes, pane, alignment, 0.5);
}
}
示例4: SetOutline
private void SetOutline(DockPanel dockPanel, DockStyle dock, bool fullPanelEdge)
{
Rectangle rect = fullPanelEdge ? dockPanel.DockArea : dockPanel.DocumentWindowBounds;
rect.Location = dockPanel.PointToScreen(rect.Location);
if (dock == DockStyle.Top)
{
int height = (int)(rect.Height * dockPanel.DockBottomPortion);
rect = new Rectangle(rect.X, rect.Y, rect.Width, height);
}
else if (dock == DockStyle.Bottom)
{
int height = (int)(rect.Height * dockPanel.DockBottomPortion);
rect = new Rectangle(rect.X, rect.Bottom - height, rect.Width, height);
}
else if (dock == DockStyle.Left)
{
int width = (int)(rect.Width * dockPanel.DockLeftPortion);
rect = new Rectangle(rect.X, rect.Y, width, rect.Height);
}
else if (dock == DockStyle.Right)
{
int width = (int)(rect.Width * dockPanel.DockRightPortion);
rect = new Rectangle(rect.Right - width, rect.Y, width, rect.Height);
}
else if (dock == DockStyle.Fill)
{
rect = dockPanel.DocumentWindowBounds;
rect.Location = dockPanel.PointToScreen(rect.Location);
}
SetDragForm(rect);
}
示例5: CreateLabel
/// <summary>
/// Create a label object with custom visual properties
/// </summary>
/// <param name="text">Text to display</param>
/// <param name="dock">Style of dock with its parent object</param>
/// <param name="height">Height of the label</param>
/// <param name="width">Width of the label</param>
/// <param name="border">If true, draw a border</param>
/// <param name="center">If true, set the text align to center</param>
/// <returns>The new label</returns>
public static Label CreateLabel(string text, DockStyle dock, int height, int width = 0, bool border = false, bool center = false)
{
// Define the object to return
Label label = new Label();
// Set the text to display
label.Text = text;
// Set the dimensions of the label
// NOTE: if width zero, will ajust to the parent object
label.Height = height;
label.Width = width;
// Draw border if required
label.BorderStyle = (border) ? BorderStyle.FixedSingle : BorderStyle.None;
// Set the dock style to use
label.Dock = dock;
// Set the font of the text
label.Font = new System.Drawing.Font(FontFamily.GenericSansSerif, 9);
// Set the text align to use.
// If not center, will use the normal top left value
label.TextAlign = (center) ? ContentAlignment.MiddleCenter : ContentAlignment.TopLeft;
return label;
}
示例6: Init
public static int Init(Control placeholder, DockStyle dockstyle)
{
currentPipeline = 0;
dockStyle = dockstyle;
Placeholder = placeholder;
return StepRun(0);
}
示例7: SliderPane
public SliderPane(MasterController masterController, Panel panel, DockStyle dockStyle)
: base(masterController, panel, dockStyle)
{
InitializeComponent();
width = min_width;
StateChange += SliderPane_StateChange;
}
示例8: AddPlugin
/// <summary>
///
/// </summary>
/// <param name="position"></param>
/// <param name="plug"></param>
public void AddPlugin(DockStyle position, IWindow plug)
{
if (position == DockStyle.Bottom)
{
this.AddBottomPlugin(this.panelPlugins, plug);
}
}
示例9: SetValues
private void SetValues(Rectangle floatWindowBounds, Control dockTo, DockStyle dock, int contentIndex) {
m_floatWindowBounds = floatWindowBounds;
m_dockTo = dockTo;
m_dock = dock;
m_contentIndex = contentIndex;
FlagTestDrop = true;
}
示例10: GetPreviewBounds
/// <summary>
/// Get preview bounds
/// </summary>
/// <param name="dock">dock for which to get the preview bounds</param>
/// <param name="movedPanel">moved panel</param>
/// <param name="panelUnderMouse">panel under mouse</param>
/// <param name="freeAreaBounds">free area bounds</param>
/// <returns>preview bounds</returns>
public static Rectangle GetPreviewBounds(DockStyle dock, Control movedPanel, Control panelUnderMouse, Rectangle freeAreaBounds)
{
Rectangle bounds = freeAreaBounds;
if (panelUnderMouse != null)
{
bounds = panelUnderMouse.RectangleToScreen(panelUnderMouse.ClientRectangle);
}
switch (dock)
{
case DockStyle.Left:
return GetInnerLeftPreviewBounds(movedPanel, bounds);
case DockStyle.Right:
return GetInnerRightPreviewBounds(movedPanel, bounds);
case DockStyle.Top:
return GetInnerTopPreviewBounds(movedPanel, bounds);
case DockStyle.Bottom:
return GetInnerBottomPreviewBounds(movedPanel, bounds);
case DockStyle.Fill:
return GetInnerFillPreviewBounds(movedPanel, bounds);
default:
throw new InvalidOperationException();
}
}
示例11: Create
public static XtraGridControl Create(string name = null, DockStyle dockStyle = DockStyle.None, int? x = null, int? y = null, int? width = null, int? height = null)
{
XtraGridControl grid = new XtraGridControl();
GridView gridView = new GridView();
((ISupportInitialize)grid).BeginInit();
((ISupportInitialize)gridView).BeginInit();
grid.MainView = gridView;
grid.Name = name;
grid.Dock = dockStyle;
grid.Font = new Font("Courier New", 8.25F, FontStyle.Regular, GraphicsUnit.Point, 0);
Point? point = zForm.GetPoint(x, y);
if (point != null)
grid.Location = (Point)point;
Size? size = zForm.GetSize(width, height);
if (size != null)
grid.Size = (Size)size;
//grid.TabIndex = 0;
gridView.GridControl = grid;
((ISupportInitialize)grid).EndInit();
((ISupportInitialize)gridView).EndInit();
return grid;
}
示例12: DockablePanel
/// <summary>
/// Initializes a new instance of the <see cref="DockablePanel"/> class.
/// </summary>
/// <param name="key">The key.</param>
/// <param name="caption">The caption.</param>
/// <param name="innerControl">The inner control.</param>
/// <param name="dock">The dock.</param>
public DockablePanel(string key, string caption, Object innerControl, DockStyle dock)
{
Dock = dock;
Key = key;
InnerControl = innerControl;
Caption = caption;
}
示例13: FloorReflectionFilterProp
public FloorReflectionFilterProp(int alphaStart, int alphaEnd, DockStyle dockPosition, int offset)
{
this.AlphaStart = alphaStart;
this.AlphaEnd = alphaEnd;
this.DockPosition = dockPosition;
this.Offset = offset;
}
示例14: Create
public static DataGridViewControl Create(string name = null, DockStyle dockStyle = DockStyle.None, int? x = null, int? y = null, int? width = null, int? height = null, bool showRowNumber = false)
{
DataGridViewCellStyle viewCellStyle = new DataGridViewCellStyle();
viewCellStyle.Alignment = DataGridViewContentAlignment.MiddleLeft;
viewCellStyle.BackColor = SystemColors.Window;
viewCellStyle.Font = new Font("Courier New", 8.25F, FontStyle.Regular, GraphicsUnit.Point, ((byte)(0)));
viewCellStyle.ForeColor = SystemColors.ControlText;
viewCellStyle.SelectionBackColor = SystemColors.Highlight;
viewCellStyle.SelectionForeColor = SystemColors.HighlightText;
viewCellStyle.WrapMode = DataGridViewTriState.False;
viewCellStyle.NullValue = "(null)";
DataGridViewControl grid = new DataGridViewControl();
((ISupportInitialize)grid).BeginInit();
grid.Name = name;
grid.Dock = dockStyle;
Point? point = zForm.GetPoint(x, y);
if (point != null)
grid.Location = (Point)point;
Size? size = zForm.GetSize(width, height);
if (size != null)
grid.Size = (Size)size;
grid.AllowUserToAddRows = false;
grid.AllowUserToDeleteRows = false;
grid.AllowUserToOrderColumns = true;
grid.ColumnHeadersHeightSizeMode = DataGridViewColumnHeadersHeightSizeMode.AutoSize;
grid.DefaultCellStyle = viewCellStyle;
grid.ReadOnly = true;
//grid.TabIndex = 0;
if (showRowNumber)
grid.RowPostPaint += grid.DataGridView_RowPostPaint;
((ISupportInitialize)grid).EndInit();
return grid;
}
示例15: MyUserControl
public MyUserControl(MasterController masterController, Panel panel, DockStyle dockStyle)
{
InitializeComponent();
this.container = panel;
this.masterController = masterController;
appear(dockStyle);
}