コード例 #1
0
        /// <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 ColumnHeaderStates value that specifies the
        /// state to draw the column header in</param>
        public static void DrawColumnHeader(Graphics g, Rectangle headerRect, Rectangle clipRect, ColumnHeaderStates 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);
            }
            else
            {
                g.FillRectangle(SystemBrushes.Control, headerRect);

                if (state == ColumnHeaderStates.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);
                }
            }
        }
コード例 #2
0
		/// <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 ColumnHeaderStates value that specifies the 
		/// state to draw the column header in</param>
		public static void DrawColumnHeader(Graphics g, Rectangle headerRect, Rectangle clipRect, ColumnHeaderStates 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);
			}
			else
			{
				g.FillRectangle(SystemBrushes.Control, headerRect);

				if (state == ColumnHeaderStates.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);
				}
			}
		}
コード例 #3
0
 /// <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 ColumnHeaderStates value that specifies the
 /// state to draw the column header in</param>
 public static void DrawColumnHeader(Graphics g, Rectangle headerRect, ColumnHeaderStates state)
 {
     ThemeManager.DrawColumnHeader(g, headerRect, headerRect, state);
 }
コード例 #4
0
		/// <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 ColumnHeaderStates value that specifies the 
		/// state to draw the column header in</param>
		public static void DrawColumnHeader(Graphics g, Rectangle headerRect, ColumnHeaderStates state)
		{
			ThemeManager.DrawColumnHeader(g, headerRect, headerRect, state);
		}