SIL.FieldWorks.Common.Controls.ExplorerBarItem.DrawButtonBackground C# (CSharp) Method

DrawButtonBackground() private method

Draws the background of the button.
private DrawButtonBackground ( Graphics g ) : void
g System.Drawing.Graphics
return void
		private void DrawButtonBackground(Graphics g)
		{
			Rectangle rc = m_button.ClientRectangle;
			Brush br = null;
			try
			{
				if (!m_gradientButton || m_buttonBackColor == Color.Empty || m_buttonBackColor == Color.Transparent)
					br = new SolidBrush(BackColor);
				else
					br = new LinearGradientBrush(rc, BackColor, m_buttonBackColor, 91f);

				g.FillRectangle(br, rc);
			}
			finally
			{
				if (br != null)
					br.Dispose();
			}
		}