ListView.GetItemRect 方法
重要
一些信息与预发行产品相关,相应产品在发行之前可能会进行重大修改。 对于此处提供的信息,Microsoft 不作任何明示或暗示的担保。
在控件中检索项的边框。
GetItemRect(Int32) |
在列表视图控件中检索特定项的边框。 |
GetItemRect(Int32, ItemBoundsPortion) |
在列表视图控件中检索指定项的边框的指定部分。 |
在列表视图控件中检索特定项的边框。
public:
System::Drawing::Rectangle GetItemRect(int index);
public System.Drawing.Rectangle GetItemRect (int index);
member this.GetItemRect : int -> System.Drawing.Rectangle
Public Function GetItemRect (index As Integer) As Rectangle
参数
- index
- Int32
位于要返回其边框的 ListView.ListViewItemCollection 内的项的从零开始的索引。
返回
Rectangle,表示指定的 ListViewItem 的边框。
注解
此版本的 方法返回的 GetItemRect 边框表示整个项,包括图标、项文本和子项文本。 若要指定项边框的特定部分,请使用 方法的其他版本 GetItemRect 。
另请参阅
适用于
.NET Framework 4.8.1 和其他版本
产品 | 版本 |
---|---|
.NET Framework | 1.1, 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 |
在列表视图控件中检索指定项的边框的指定部分。
public:
System::Drawing::Rectangle GetItemRect(int index, System::Windows::Forms::ItemBoundsPortion portion);
public System.Drawing.Rectangle GetItemRect (int index, System.Windows.Forms.ItemBoundsPortion portion);
member this.GetItemRect : int * System.Windows.Forms.ItemBoundsPortion -> System.Drawing.Rectangle
Public Function GetItemRect (index As Integer, portion As ItemBoundsPortion) As Rectangle
参数
- index
- Int32
位于要返回其边框的 ListView.ListViewItemCollection 内的项的从零开始的索引。
- portion
- ItemBoundsPortion
ItemBoundsPortion 值之一,表示要为其检索边框的 ListViewItem 的一部分。
返回
Rectangle,表示指定 ListViewItem 的指定部分的边框。
注解
此版本的 方法返回的 GetItemRect 边框仅表示 参数中指定的 portion
项的节。 若要返回整个项的边框,请使用 方法的另一个 GetItemRect 版本。
另请参阅
适用于
.NET Framework 4.8.1 和其他版本
产品 | 版本 |
---|---|
.NET Framework | 1.1, 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 |