/// <summary> /// Draws a column header in the specified state, on the specified graphics /// surface, and within the specified bounds /// </summary> /// <param name="g">The Graphics to draw on</param> /// <param name="headerRect">The Rectangle that represents the dimensions /// of the column header</param> /// <param name="clipRect">The Rectangle that represents the clipping area</param> /// <param name="state">A ColumnHeaderState value that specifies the /// state to draw the column header in</param> public static void DrawColumnHeader(Graphics g, Rectangle headerRect, Rectangle clipRect, ColumnHeaderState state) { if (g == null || headerRect.Width <= 0 || headerRect.Height <= 0 || clipRect.Width <= 0 || clipRect.Height <= 0) { return; } if (ThemeManager.VisualStylesEnabled) { //ThemeManager.DrawThemeBackground(g, ThemeClasses.ColumnHeader, (int) ColumnHeaderParts.HeaderItem, (int) state, headerRect, clipRect); VisualStyleRenderer renderer; switch (state) { case ColumnHeaderState.Hot: renderer = new VisualStyleRenderer(VisualStyleElement.Header.Item.Hot); break; case ColumnHeaderState.Pressed: renderer = new VisualStyleRenderer(VisualStyleElement.Header.Item.Pressed); break; case ColumnHeaderState.Normal: default: renderer = new VisualStyleRenderer(VisualStyleElement.Header.Item.Normal); break; } renderer.DrawBackground(g, headerRect, clipRect); } else { g.FillRectangle(SystemBrushes.Control, headerRect); if (state == ColumnHeaderState.Pressed) { g.DrawRectangle(SystemPens.ControlDark, headerRect.X, headerRect.Y, headerRect.Width-1, headerRect.Height-1); } else { ControlPaint.DrawBorder3D(g, headerRect.X, headerRect.Y, headerRect.Width, headerRect.Height, Border3DStyle.RaisedInner); } } }
/// <summary> /// Draws a column header in the specified state, on the specified graphics /// surface, and within the specified bounds /// </summary> /// <param name="g">The Graphics to draw on</param> /// <param name="headerRect">The Rectangle that represents the dimensions /// of the column header</param> /// <param name="clipRect">The Rectangle that represents the clipping area</param> /// <param name="state">A ColumnHeaderState value that specifies the /// state to draw the column header in</param> public static void DrawColumnHeader(Graphics g, Rectangle headerRect, Rectangle clipRect, ColumnHeaderState state) { if (g == null || headerRect.Width <= 0 || headerRect.Height <= 0 || clipRect.Width <= 0 || clipRect.Height <= 0) { return; } if (ThemeManager.VisualStylesEnabled) { //ThemeManager.DrawThemeBackground(g, ThemeClasses.ColumnHeader, (int) ColumnHeaderParts.HeaderItem, (int) state, headerRect, clipRect); VisualStyleRenderer renderer; switch (state) { case ColumnHeaderState.Hot: renderer = new VisualStyleRenderer(VisualStyleElement.Header.Item.Hot); break; case ColumnHeaderState.Pressed: renderer = new VisualStyleRenderer(VisualStyleElement.Header.Item.Pressed); break; case ColumnHeaderState.Normal: default: renderer = new VisualStyleRenderer(VisualStyleElement.Header.Item.Normal); break; } renderer.DrawBackground(g, headerRect, clipRect); } else { g.FillRectangle(SystemBrushes.Control, headerRect); if (state == ColumnHeaderState.Pressed) { g.DrawRectangle(SystemPens.ControlDark, headerRect.X, headerRect.Y, headerRect.Width - 1, headerRect.Height - 1); } else { ControlPaint.DrawBorder3D(g, headerRect.X, headerRect.Y, headerRect.Width, headerRect.Height, Border3DStyle.RaisedInner); } } }
/// <summary> /// Draws a column header in the specified state, on the specified graphics /// surface, and within the specified bounds /// </summary> /// <param name="g">The Graphics to draw on</param> /// <param name="headerRect">The Rectangle that represents the dimensions /// of the column header</param> /// <param name="state">A ColumnHeaderState value that specifies the /// state to draw the column header in</param> public static void DrawColumnHeader(Graphics g, Rectangle headerRect, ColumnHeaderState state) { ThemeManager.DrawColumnHeader(g, headerRect, headerRect, state); }