当前位置: 首页>>代码示例>>C#>>正文


C# DockStyle类代码示例

本文整理汇总了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;
 }
开发者ID:DIVEROVIEDO,项目名称:DotSpatial,代码行数:14,代码来源:DockablePanel.cs

示例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);
             }
         }
     }
 }
开发者ID:solitas,项目名称:SolitasWinformControllib,代码行数:25,代码来源:FlatTabRenderer.cs

示例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);
            }
        }
开发者ID:lostinspacebar,项目名称:dockpanelsuite,代码行数:32,代码来源:FloatWindow.cs

示例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);
		}
开发者ID:xuchuansheng,项目名称:GenXSource,代码行数:32,代码来源:DockOutline.cs

示例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;
        }
开发者ID:CLN-Group,项目名称:Share-This-WinForms,代码行数:38,代码来源:Muro.cs

示例6: Init

 public static int Init(Control placeholder, DockStyle dockstyle)
 {
     currentPipeline = 0;
     dockStyle = dockstyle;
     Placeholder = placeholder;
     return StepRun(0);
 }
开发者ID:666marat666,项目名称:Diplom,代码行数:7,代码来源:PipelinesManager.cs

示例7: SliderPane

 public SliderPane(MasterController masterController, Panel panel, DockStyle dockStyle)
     : base(masterController, panel, dockStyle)
 {
     InitializeComponent();
     width = min_width;
     StateChange += SliderPane_StateChange;
 }
开发者ID:shiroh10,项目名称:X-O-Genesis,代码行数:7,代码来源:SliderPane.cs

示例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);
     }
 }
开发者ID:jeasonyoung,项目名称:csharp_sfit,代码行数:12,代码来源:StudentMainWindow.cs

示例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;
		}
开发者ID:GodLesZ,项目名称:svn-dump,代码行数:7,代码来源:DockOutlineBase.cs

示例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();
             }
        }
开发者ID:Remurr,项目名称:nDbg,代码行数:37,代码来源:InnerDockPreviewEngine.cs

示例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;
        }
开发者ID:labeuze,项目名称:source,代码行数:27,代码来源:XtraGridControl.cs

示例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;
 }
开发者ID:joelmuzz,项目名称:DotSpatial,代码行数:14,代码来源:DockablePanel.cs

示例13: FloorReflectionFilterProp

 public FloorReflectionFilterProp(int alphaStart, int alphaEnd, DockStyle dockPosition, int offset)
 {
     this.AlphaStart = alphaStart;
     this.AlphaEnd = alphaEnd;
     this.DockPosition = dockPosition;
     this.Offset = offset;
 }
开发者ID:xuchuansheng,项目名称:GenXSource,代码行数:7,代码来源:UndoHelper.cs

示例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;
        }
开发者ID:labeuze,项目名称:source,代码行数:34,代码来源:DataGridViewControl.cs

示例15: MyUserControl

 public MyUserControl(MasterController masterController, Panel panel, DockStyle dockStyle)
 {
     InitializeComponent();
     this.container = panel;
     this.masterController = masterController;
     appear(dockStyle);
 }
开发者ID:DarkSaito29,项目名称:X-O-Genesis,代码行数:7,代码来源:MyUserControl.cs


注:本文中的DockStyle类示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。