Infragistics(R) NetAdvantage(R) Windows Forms
DrawBackColor Method
See Also  Example E-mail your feedback on this topic.
Infragistics.Win Namespace > UIElement Class : DrawBackColor Method

drawParams
The UIElementDrawParams used to provide rendering information.
Default backcolor drawing just does a FillRectangle with the backcolor.

Syntax

Visual Basic (Declaration) 
Protected Overridable Sub DrawBackColor( _
   ByRef drawParams As UIElementDrawParams _
) 
C# 
protected virtual void DrawBackColor( 
   ref UIElementDrawParams drawParams
)

Parameters

drawParams
The UIElementDrawParams used to provide rendering information.

Example

This sample overrides the virtual method DrawBackColor on UIElement. It calls the base implementation then draws a semi transparant hatch.

Visual BasicCopy Code
Imports System.Drawing
Imports System.Drawing.Drawing2D  
Imports Infragistics.Win

Protected Overrides Sub DrawBackColor(ByRef drawParams As UIElementDrawParams)
      
		' First Draw background.
       MyBase.DrawBackColor(drawParams)

		' Draw a hatch pattern over the control.
       Dim brush As HatchBrush = New HatchBrush(HatchStyle.Percent50, Color.White, Color.Transparent)

       drawParams.Graphics.FillRectangle(brush, drawParams.InvalidRect)
       brush.Dispose()

   End Sub
C#Copy Code
using System.Drawing;
using System.Drawing.Drawing2D;	
using Infragistics.Win;

protected override void DrawBackColor(ref UIElementDrawParams drawParams)
{

	//First Draw background.
	base.DrawBackColor( ref drawParams );

	//Draw a hatch pattern over the control.
	HatchBrush brush = new Drawing2D.HatchBrush( HatchStyle.Percent50, Color.White, Color.Transparent );

	drawParams.Graphics.FillRectangle( brush, drawParams.InvalidRect );
	brush.Dispose();

}

See Also