/// <summary> /// Initializes a new instance of the BaseEPanel class. /// </summary> protected BaseEPanel() { this.SetStyle(ControlStyles.ResizeRedraw, true); this.SetStyle(ControlStyles.AllPaintingInWmPaint, true); this.SetStyle(ControlStyles.UserPaint, true); this.SetStyle(ControlStyles.DoubleBuffer, true); this.SetStyle(ControlStyles.SupportsTransparentBackColor, true); this.SetStyle(ControlStyles.ContainerControl, true); this.CaptionFont = new Font(SystemFonts.CaptionFont.FontFamily, SystemFonts.CaptionFont.SizeInPoints - 1.0F, FontStyle.Bold); this.CaptionHeight = 25; this.PanelStyle = PanelStyle.Default; this.m_panelColors = new PanelColors(this); this.m_imageSize = new Size(16, 16); this.m_imageRectangle = Rectangle.Empty; this.m_toolTip = new ToolTip(); }
/// <summary> /// Sets the PanelProperties for the EPanel /// </summary> /// <param name="panelColors">The PanelColors table</param> public override void SetPanelProperties(PanelColors panelColors) { this.m_imgHoverBackground = null; base.SetPanelProperties(panelColors); }
/// <summary> /// Sets the PanelStyle and PanelColors table in the given control collection. /// </summary> /// <param name="controls">A collection of child controls</param> /// <param name="panelStyle">Style of the panel</param> /// <param name="panelColors">The PanelColors table</param> public static void SetPanelProperties(Control.ControlCollection controls, PanelStyle panelStyle, PanelColors panelColors) { if (panelColors == null) { throw new ArgumentNullException("panelColors", string.Format(CultureInfo.InvariantCulture, Resources.IDS_ArgumentException, "panelColors")); } ArrayList panels = FindPanels(true, controls); foreach (BaseEPanel panel in panels) { panel.PanelStyle = panelStyle; panelColors.EPanel = panel; panel.SetPanelProperties(panelColors); } ArrayList xpanderPanelLists = FindPanelLists(true, controls); foreach (XPanderPanelList xpanderPanelList in xpanderPanelLists) { xpanderPanelList.PanelStyle = panelStyle; xpanderPanelList.PanelColors = panelColors; } }
/// <summary> /// Sets the PanelProperties for a Panel or XPanderPanel /// </summary> /// <param name="panelColors">The PanelColors table</param> public virtual void SetPanelProperties(PanelColors panelColors) { if (panelColors == null) { throw new ArgumentException( string.Format( CultureInfo.CurrentUICulture, Resources.IDS_ArgumentException, "panelColors")); } this.m_panelColors = panelColors; this.ColorScheme = ColorScheme.Professional; this.Invalidate(true); }
/// <summary> /// Raises the PanelStyle changed event. /// </summary> /// <param name="sender">The source of the event.</param> /// <param name="e">A PanelStyleChangeEventArgs that contains the event data.</param> protected virtual void OnPanelStyleChanged(object sender, PanelStyleChangeEventArgs e) { PanelStyle panelStyle = e.PanelStyle; switch (panelStyle) { case PanelStyle.Default: m_panelColors = new PanelColors(this); break; case PanelStyle.Office2007: m_panelColors = new PanelColorsOffice2007Blue(this); break; } Invalidate(true); if (this.PanelStyleChanged != null) { this.PanelStyleChanged(sender, e); } }