System.Windows.Forms.ThemeWin32Classic.DrawToolBarToggleButtonBackground C# (CSharp) Method

DrawToolBarToggleButtonBackground() protected method

protected DrawToolBarToggleButtonBackground ( Graphics dc, System.Windows.Forms.ToolBarItem item ) : void
dc System.Drawing.Graphics
item System.Windows.Forms.ToolBarItem
return void
		protected virtual void DrawToolBarToggleButtonBackground (Graphics dc, ToolBarItem item)
		{
			Brush brush;
			Rectangle area = item.Rectangle;
			area.X += ToolBarImageGripWidth;
			area.Y += ToolBarImageGripWidth;
			area.Width -= 2 * ToolBarImageGripWidth;
			area.Height -= 2 * ToolBarImageGripWidth;
			
			if (item.Button.Pushed)
				brush = (Brush) ResPool.GetHatchBrush (HatchStyle.Percent50, ColorScrollBar, ColorControlLightLight);
			else if (item.Button.PartialPush)
				brush = SystemBrushes.ControlLight;
			else
				brush = SystemBrushes.Control;
			 
			dc.FillRectangle (brush, area);
		}
ThemeWin32Classic