ListView.GetItemRect 方法

定義

擷取控制項中項目的週框 (Bounding Rectangle)。

多載

GetItemRect(Int32)

擷取清單檢視控制項內特定項目的周框。

GetItemRect(Int32, ItemBoundsPortion)

擷取清單檢視控制項中,特定項目之周框的特定部分。

GetItemRect(Int32)

擷取清單檢視控制項內特定項目的周框。

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

Rectangle,表示特定 ListViewItem 的周框。

備註

這個方法版本 GetItemRect 傳回的周框代表整個專案,包括圖示、專案文字和子專案文字。 若要指定專案周框的特定部分,請使用其他版本的 GetItemRect 方法。

另請參閱

適用於

GetItemRect(Int32, ItemBoundsPortion)

擷取清單檢視控制項中,特定項目之周框的特定部分。

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

Rectangle,表示特定 ListViewItem 之特定部分的周框。

備註

這個方法版本所傳回的 GetItemRect 周框只代表 參數中指定的 portion 專案區段。 若要傳回整個專案的周框,請使用其他版本的 GetItemRect 方法。

另請參閱

適用於