private static void DrawInnerBorders(Graphics graphics, ExpondPanel expondPanel) { if (expondPanel.ShowBorder == true) { using (GraphicsPath graphicsPath = new GraphicsPath()) { Rectangle captionRectangle = expondPanel.CaptionRectangle; ExpondPanelList expondPanelList = expondPanel.Parent as ExpondPanelList; if ((expondPanelList != null) && (expondPanelList.Dock == DockStyle.Fill)) { PanelEx panel = expondPanelList.Parent as PanelEx; ExpondPanel parentExpondPanel = expondPanelList.Parent as ExpondPanel; if (((panel != null) && (panel.Padding == new Padding(0))) || ((parentExpondPanel != null) && (parentExpondPanel.Padding == new Padding(0)))) { //Left vertical borderline graphicsPath.AddLine(captionRectangle.X, captionRectangle.Y + captionRectangle.Height, captionRectangle.X, captionRectangle.Y + StaticResource.BorderThickness); if (expondPanel.Top == 0) { //Upper horizontal borderline graphicsPath.AddLine(captionRectangle.X, captionRectangle.Y, captionRectangle.X + captionRectangle.Width, captionRectangle.Y); } else { //Upper horizontal borderline graphicsPath.AddLine(captionRectangle.X, captionRectangle.Y + StaticResource.BorderThickness, captionRectangle.X + captionRectangle.Width, captionRectangle.Y + StaticResource.BorderThickness); } } } else { //Left vertical borderline graphicsPath.AddLine(captionRectangle.X + StaticResource.BorderThickness, captionRectangle.Y + captionRectangle.Height, captionRectangle.X + StaticResource.BorderThickness, captionRectangle.Y); if (expondPanel.Top == 0) { //Upper horizontal borderline graphicsPath.AddLine(captionRectangle.X + StaticResource.BorderThickness, captionRectangle.Y + StaticResource.BorderThickness, captionRectangle.X + captionRectangle.Width - StaticResource.BorderThickness, captionRectangle.Y + StaticResource.BorderThickness); } else { //Upper horizontal borderline graphicsPath.AddLine(captionRectangle.X + StaticResource.BorderThickness, captionRectangle.Y, captionRectangle.X + captionRectangle.Width - StaticResource.BorderThickness, captionRectangle.Y); } } using (Pen borderPen = new Pen(expondPanel.PanelColors.InnerBorderColor)) { graphics.DrawPath(borderPen, graphicsPath); } } } }
public override bool OnMouseDown(System.Windows.Forms.Design.Behavior.Glyph g, MouseButtons button, Point mouseLoc) { if ((this.m_expondPanel != null) && (this.m_expondPanel.Expand == false)) { ExpondPanelList expondPanelList = this.m_expondPanel.Parent as ExpondPanelList; if (expondPanelList != null) { expondPanelList.Expand(this.m_expondPanel); this.m_expondPanel.Invalidate(false); } } return(true); // indicating we processed this event. }
internal ExpondPanelCollection(ExpondPanelList expondPanelList) { this._expondPanelList = expondPanelList; this._controlCollection = this._expondPanelList.Controls; }
private static void DrawBorders(Graphics graphics, ExpondPanel expondPanel) { if (expondPanel.ShowBorder == true) { using (GraphicsPath graphicsPath = new GraphicsPath()) { using (Pen borderPen = new Pen(expondPanel.PanelColors.BorderColor, StaticResource.BorderThickness)) { Rectangle captionRectangle = expondPanel.CaptionRectangle; Rectangle borderRectangle = captionRectangle; if (expondPanel.Expand == true) { borderRectangle = expondPanel.ClientRectangle; graphics.DrawLine( borderPen, captionRectangle.Left, captionRectangle.Top + captionRectangle.Height - StaticResource.BorderThickness, captionRectangle.Left + captionRectangle.Width, captionRectangle.Top + captionRectangle.Height - StaticResource.BorderThickness); } ExpondPanelList expondPanelList = expondPanel.Parent as ExpondPanelList; if ((expondPanelList != null) && (expondPanelList.Dock == DockStyle.Fill)) { PanelEx panel = expondPanelList.Parent as PanelEx; ExpondPanel parentExpondPanel = expondPanelList.Parent as ExpondPanel; if (((panel != null) && (panel.Padding == new Padding(0))) || ((parentExpondPanel != null) && (parentExpondPanel.Padding == new Padding(0)))) { if (expondPanel.Top != 0) { graphicsPath.AddLine( borderRectangle.Left, borderRectangle.Top, borderRectangle.Left + captionRectangle.Width, borderRectangle.Top); } // Left vertical borderline graphics.DrawLine(borderPen, borderRectangle.Left, borderRectangle.Top, borderRectangle.Left, borderRectangle.Top + borderRectangle.Height); // Right vertical borderline graphics.DrawLine(borderPen, borderRectangle.Left + borderRectangle.Width - StaticResource.BorderThickness, borderRectangle.Top, borderRectangle.Left + borderRectangle.Width - StaticResource.BorderThickness, borderRectangle.Top + borderRectangle.Height); } else { // Upper horizontal borderline only at the top expondPanel if (expondPanel.Top == 0) { graphicsPath.AddLine( borderRectangle.Left, borderRectangle.Top, borderRectangle.Left + borderRectangle.Width, borderRectangle.Top); } // Left vertical borderline graphicsPath.AddLine( borderRectangle.Left, borderRectangle.Top, borderRectangle.Left, borderRectangle.Top + borderRectangle.Height); //Lower horizontal borderline graphicsPath.AddLine( borderRectangle.Left, borderRectangle.Top + borderRectangle.Height - StaticResource.BorderThickness, borderRectangle.Left + borderRectangle.Width - StaticResource.BorderThickness, borderRectangle.Top + borderRectangle.Height - StaticResource.BorderThickness); // Right vertical borderline graphicsPath.AddLine( borderRectangle.Left + borderRectangle.Width - StaticResource.BorderThickness, borderRectangle.Top, borderRectangle.Left + borderRectangle.Width - StaticResource.BorderThickness, borderRectangle.Top + borderRectangle.Height); } } else { // Upper horizontal borderline only at the top expondPanel if (expondPanel.Top == 0) { graphicsPath.AddLine( borderRectangle.Left, borderRectangle.Top, borderRectangle.Left + borderRectangle.Width, borderRectangle.Top); } // Left vertical borderline graphicsPath.AddLine( borderRectangle.Left, borderRectangle.Top, borderRectangle.Left, borderRectangle.Top + borderRectangle.Height); //Lower horizontal borderline graphicsPath.AddLine( borderRectangle.Left, borderRectangle.Top + borderRectangle.Height - StaticResource.BorderThickness, borderRectangle.Left + borderRectangle.Width - StaticResource.BorderThickness, borderRectangle.Top + borderRectangle.Height - StaticResource.BorderThickness); // Right vertical borderline graphicsPath.AddLine( borderRectangle.Left + borderRectangle.Width - StaticResource.BorderThickness, borderRectangle.Top, borderRectangle.Left + borderRectangle.Width - StaticResource.BorderThickness, borderRectangle.Top + borderRectangle.Height); } } using (Pen borderPen = new Pen(expondPanel.PanelColors.BorderColor, StaticResource.BorderThickness)) { graphics.DrawPath(borderPen, graphicsPath); } } } }
public override void Initialize(System.ComponentModel.IComponent component) { base.Initialize(component); this.m_expondPanelList = (ExpondPanelList)this.Control; this.m_expondPanelList.AutoScroll = false; }