public DockingHint(eDockingHintSide hintSide, bool middleDockingHint, eDotNetBarStyle style) { // // Required for Windows Form Designer support // InitializeComponent(); _Style = style; m_MiddleDockHint = middleDockingHint; this.SetStyle(ControlStyles.Selectable, false); this.SetStyle(ControlStyles.AllPaintingInWmPaint, true); this.SetStyle(DisplayHelp.DoubleBufferFlag, true); this.SetStyle(ControlStyles.Opaque, true); m_DockingHintSide = hintSide; UpdateControlRegion(); }
public GraphicsPath GetHintPath(eDockingHintSide hintSide) { // Create top hint path then rotate depending on desired side GraphicsPath path = new GraphicsPath(); if (hintSide == eDockingHintSide.DockTab) { if (_Style == eDotNetBarStyle.Office2010 || _Style == eDotNetBarStyle.Metro) path.AddRectangle(new Rectangle(40, 40, 32, 32)); else path.AddRectangle(new Rectangle(29, 29, 29, 29)); } else { path.StartFigure(); if (_Style == eDotNetBarStyle.Office2010 || _Style == eDotNetBarStyle.Metro) { //path.AddLine(26, 36, 36, 26); //path.AddLine(36, 0, 76, 0); //path.AddLine(76, 26, 86, 36); path.AddLine(27, 35, 36, 26); path.AddLine(36, 0, 76, 0); path.AddLine(76, 26, 86, 35); } else { path.AddLine(23, 28, 28, 23); path.AddLine(29, 23, 29, 0); path.AddLine(57, 0, 57, 23); path.AddLine(58, 23, 63, 28); } } switch (hintSide) { case eDockingHintSide.Bottom: { using (Matrix matrix = new Matrix()) { matrix.Rotate(180); if (_Style == eDotNetBarStyle.Office2010 || _Style == eDotNetBarStyle.Metro) matrix.Translate(-path.GetBounds().Width * 2 + 6, -path.GetBounds().Height * 2 - 42); else matrix.Translate(-path.GetBounds().Width * 2 - 6, -path.GetBounds().Height * 2 - 30); path.Transform(matrix); } break; } case eDockingHintSide.Left: { using (Matrix matrix = new Matrix()) { matrix.Rotate(-90); if (_Style == eDotNetBarStyle.Office2010 || _Style == eDotNetBarStyle.Metro) matrix.Translate(-53, 0); else matrix.Translate(-46, 0); path.Transform(matrix); matrix.Reset(); matrix.Translate(0, path.GetBounds().Height); path.Transform(matrix); } break; } case eDockingHintSide.Right: { using (Matrix matrix = new Matrix()) { matrix.Rotate(90); path.Transform(matrix); matrix.Reset(); if (_Style == eDotNetBarStyle.Office2010 || _Style == eDotNetBarStyle.Metro) matrix.Translate(path.GetBounds().Width * 2 + 42, 0); else matrix.Translate(path.GetBounds().Width * 2 + 30, 0); path.Transform(matrix); } break; } } return path; }
public DockingHint(eDockingHintSide hintSide, eDotNetBarStyle style) : this(hintSide, false, style) { }