Edit

Share via


VisualStyleRenderer.HitTestBackground Method

Definition

Determines whether a point is contained in the background of the current visual style element.

Overloads

HitTestBackground(IDeviceContext, Rectangle, IntPtr, Point, HitTestOptions)

Returns a hit test code indicating whether the point is contained in the background of the current visual style element and within the specified region.

HitTestBackground(IDeviceContext, Rectangle, Point, HitTestOptions)

Returns a hit test code indicating whether a point is contained in the background of the current visual style element.

HitTestBackground(Graphics, Rectangle, Region, Point, HitTestOptions)

Returns a hit test code indicating whether the point is contained in the background of the current visual style element and within the specified bounds.

HitTestBackground(IDeviceContext, Rectangle, IntPtr, Point, HitTestOptions)

Source:
VisualStyleRenderer.cs
Source:
VisualStyleRenderer.cs
Source:
VisualStyleRenderer.cs

Returns a hit test code indicating whether the point is contained in the background of the current visual style element and within the specified region.

public System.Windows.Forms.VisualStyles.HitTestCode HitTestBackground(System.Drawing.IDeviceContext dc, System.Drawing.Rectangle backgroundRectangle, IntPtr hRgn, System.Drawing.Point pt, System.Windows.Forms.VisualStyles.HitTestOptions options);

Parameters

dc
IDeviceContext

The IDeviceContext this operation will use.

backgroundRectangle
Rectangle

A Rectangle that contains the background of the current visual style element.

hRgn
IntPtr

A Windows handle to a Region that specifies the bounds of the hit test area within the background.

pt
Point

The Point to test.

options
HitTestOptions

A bitwise combination of the HitTestOptions values.

Returns

A HitTestCode that describes where pt is located in the background of the current visual style element.

Exceptions

dc is null.

Applies to

.NET Framework 4.8.1 and other versions
Product Versions
.NET Framework 2.0, 3.0, 3.5, 4.0, 4.5, 4.5.1, 4.5.2, 4.6, 4.6.1, 4.6.2, 4.7, 4.7.1, 4.7.2, 4.8, 4.8.1
Windows Desktop 3.0, 3.1, 5, 6, 7, 8, 9, 10

HitTestBackground(IDeviceContext, Rectangle, Point, HitTestOptions)

Source:
VisualStyleRenderer.cs
Source:
VisualStyleRenderer.cs
Source:
VisualStyleRenderer.cs

Returns a hit test code indicating whether a point is contained in the background of the current visual style element.

public System.Windows.Forms.VisualStyles.HitTestCode HitTestBackground(System.Drawing.IDeviceContext dc, System.Drawing.Rectangle backgroundRectangle, System.Drawing.Point pt, System.Windows.Forms.VisualStyles.HitTestOptions options);

Parameters

dc
IDeviceContext

The IDeviceContext this operation will use.

backgroundRectangle
Rectangle

A Rectangle that contains the background of the current visual style element.

pt
Point

The Point to test.

options
HitTestOptions

A bitwise combination of the HitTestOptions values.

Returns

A HitTestCode that describes where pt is located in the background of the current visual style element.

Exceptions

dc is null.

Applies to

.NET Framework 4.8.1 and other versions
Product Versions
.NET Framework 2.0, 3.0, 3.5, 4.0, 4.5, 4.5.1, 4.5.2, 4.6, 4.6.1, 4.6.2, 4.7, 4.7.1, 4.7.2, 4.8, 4.8.1
Windows Desktop 3.0, 3.1, 5, 6, 7, 8, 9, 10

HitTestBackground(Graphics, Rectangle, Region, Point, HitTestOptions)

Source:
VisualStyleRenderer.cs
Source:
VisualStyleRenderer.cs
Source:
VisualStyleRenderer.cs

Returns a hit test code indicating whether the point is contained in the background of the current visual style element and within the specified bounds.

public System.Windows.Forms.VisualStyles.HitTestCode HitTestBackground(System.Drawing.Graphics g, System.Drawing.Rectangle backgroundRectangle, System.Drawing.Region region, System.Drawing.Point pt, System.Windows.Forms.VisualStyles.HitTestOptions options);

Parameters

g
Graphics

The Graphics this operation will use.

backgroundRectangle
Rectangle

A Rectangle that contains the background of the current visual style element.

region
Region

A Region that specifies the bounds of the hit test area within the background.

pt
Point

The Point to test.

options
HitTestOptions

A bitwise combination of the HitTestOptions values.

Returns

A HitTestCode that describes where pt is located in the background of the current visual style element, if at all.

Exceptions

Applies to

.NET Framework 4.8.1 and other versions
Product Versions
.NET Framework 2.0, 3.0, 3.5, 4.0, 4.5, 4.5.1, 4.5.2, 4.6, 4.6.1, 4.6.2, 4.7, 4.7.1, 4.7.2, 4.8, 4.8.1
Windows Desktop 3.0, 3.1, 5, 6, 7, 8, 9, 10