ToolStrip.GetItemAt 方法

定义

返回位于指定位置的项。

重载

GetItemAt(Int32, Int32)

返回位于 ToolStrip 工作区的指定 X 坐标和 Y 坐标的项。

GetItemAt(Point)

返回位于 ToolStrip 的工作区中指定点的项。

GetItemAt(Int32, Int32)

Source:
ToolStrip.cs
Source:
ToolStrip.cs
Source:
ToolStrip.cs

返回位于 ToolStrip 工作区的指定 X 坐标和 Y 坐标的项。

C#
public System.Windows.Forms.ToolStripItem GetItemAt(int x, int y);
C#
public System.Windows.Forms.ToolStripItem? GetItemAt(int x, int y);

参数

x
Int32

从工作区左边缘开始算的水平坐标,以像素为单位。

y
Int32

从工作区上边缘开始算的垂直坐标,以像素为单位。

返回

指定位置处的 ToolStripItem,如果找不到 ToolStripItem,则为 null

适用于

.NET Framework 4.8.1 和其他版本
产品 版本
.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

GetItemAt(Point)

Source:
ToolStrip.cs
Source:
ToolStrip.cs
Source:
ToolStrip.cs

返回位于 ToolStrip 的工作区中指定点的项。

C#
public System.Windows.Forms.ToolStripItem GetItemAt(System.Drawing.Point point);
C#
public System.Windows.Forms.ToolStripItem? GetItemAt(System.Drawing.Point point);

参数

point
Point

Point,在此处搜索 ToolStripItem

返回

指定位置处的 ToolStripItem,如果找不到 ToolStripItem,则为 null

另请参阅

适用于

.NET Framework 4.8.1 和其他版本
产品 版本
.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