VisualStyleRenderer.HitTestBackground 方法

定义

确定某个点是否包含在当前视觉样式元素的背景中。Determines whether a point is contained in the background of the current visual style element.

重载

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)

返回一个命中测试代码,指示该点是否包含在当前视觉样式元素的背景中的指定区域内。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);
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);
member this.HitTestBackground : System.Drawing.IDeviceContext * System.Drawing.Rectangle * nativeint * System.Drawing.Point * System.Windows.Forms.VisualStyles.HitTestOptions -> System.Windows.Forms.VisualStyles.HitTestCode
Public Function HitTestBackground (dc As IDeviceContext, backgroundRectangle As Rectangle, hRgn As IntPtr, pt As Point, options As HitTestOptions) As HitTestCode

参数

dc
IDeviceContext

此操作将使用的 IDeviceContextThe IDeviceContext this operation will use.

backgroundRectangle
Rectangle

一个 Rectangle,它包含当前视觉样式元素的背景。A Rectangle that contains the background of the current visual style element.

hRgn
IntPtr

一个指向用于指定背景内命中测试区域边界的 Region 的 Windows 句柄。A Windows handle to a Region that specifies the bounds of the hit test area within the background.

pt
Point

要测试的 PointThe Point to test.

options
HitTestOptions

HitTestOptions 值的按位组合。A bitwise combination of the HitTestOptions values.

返回

一个 HitTestCode,它描述 pt 在当前视觉样式元素的背景中所处的位置。A HitTestCode that describes where pt is located in the background of the current visual style element.

异常

dcnulldc is null.

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.

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);
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);
member this.HitTestBackground : System.Drawing.IDeviceContext * System.Drawing.Rectangle * System.Drawing.Point * System.Windows.Forms.VisualStyles.HitTestOptions -> System.Windows.Forms.VisualStyles.HitTestCode
Public Function HitTestBackground (dc As IDeviceContext, backgroundRectangle As Rectangle, pt As Point, options As HitTestOptions) As HitTestCode

参数

dc
IDeviceContext

此操作将使用的 IDeviceContextThe IDeviceContext this operation will use.

backgroundRectangle
Rectangle

一个 Rectangle,它包含当前视觉样式元素的背景。A Rectangle that contains the background of the current visual style element.

pt
Point

要测试的 PointThe Point to test.

options
HitTestOptions

HitTestOptions 值的按位组合。A bitwise combination of the HitTestOptions values.

返回

一个 HitTestCode,它描述 pt 在当前视觉样式元素的背景中所处的位置。A HitTestCode that describes where pt is located in the background of the current visual style element.

异常

dcnulldc is null.

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.

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);
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);
member this.HitTestBackground : System.Drawing.Graphics * System.Drawing.Rectangle * System.Drawing.Region * System.Drawing.Point * System.Windows.Forms.VisualStyles.HitTestOptions -> System.Windows.Forms.VisualStyles.HitTestCode

参数

g
Graphics

此操作将使用的 GraphicsThe Graphics this operation will use.

backgroundRectangle
Rectangle

一个 Rectangle,它包含当前视觉样式元素的背景。A Rectangle that contains the background of the current visual style element.

region
Region

一个 Region,它指定背景中命中测试区域的边界。A Region that specifies the bounds of the hit test area within the background.

pt
Point

要测试的 PointThe Point to test.

options
HitTestOptions

HitTestOptions 值的按位组合。A bitwise combination of the HitTestOptions values.

返回

一个 HitTestCode,它描述 pt 在当前视觉样式元素的背景中所处的位置(如果位于背景中)。A HitTestCode that describes where pt is located in the background of the current visual style element, if at all.

异常

gnullg is null.

适用于