| Visual Basic (Declaration) | |
|---|---|
Protected Overridable Sub DrawFocus( _ ByRef drawParams As UIElementDrawParams _ ) | |
| C# | |
|---|---|
protected virtual void DrawFocus( ref UIElementDrawParams drawParams ) | |
Parameters
- drawParams
- The UIElementDrawParams used to provide rendering information.
This sample overrides the virtual method DrawFocus off of UIElement. Here we use ControlPaint to draw a focus rectangle around the specified rect.
| Visual Basic | Copy Code |
|---|---|
Imports Infragistics.Win Protected Overrides Sub DrawFocus(ByRef drawParams As UIElementDrawParams) ' Get the rect inside bounding border. Dim rect As Rectangle = me.RectInsideBorders ' Draw the focus rectangle using the ControlPaint class. ControlPaint.DrawFocusRectangle(drawParams.Graphics, _ rect, drawParams.AppearanceData.GetForeColor(Me.Enabled), _ drawParams.AppearanceData.GetBackColor(Me.Enabled)) End Sub | |
| C# | Copy Code |
|---|---|
using Infragistics.Win; protected override void DrawFocus(ref UIElementDrawParams drawParams) { // Get the rect inside bounding border. Rectangle rect = this.RectInsideBorders; // Draw the focus rectangle using the ControlPaint class. ControlPaint.DrawFocusRectangle(drawParams.Graphics, rect,drawParams.AppearanceData.GetForeColor(this.Enabled), drawParams.AppearanceData.GetBackColor(this.Enabled)); } | |