Share via


IGridProvider.GetItem(Int32, Int32) 方法

定義

擷取指定儲存格的使用者介面自動化提供者。

public:
 System::Windows::Automation::Provider::IRawElementProviderSimple ^ GetItem(int row, int column);
public System.Windows.Automation.Provider.IRawElementProviderSimple GetItem (int row, int column);
abstract member GetItem : int * int -> System.Windows.Automation.Provider.IRawElementProviderSimple
Public Function GetItem (row As Integer, column As Integer) As IRawElementProviderSimple

參數

row
Int32

重要的資料列序號。

column
Int32

重要的資料行序號。

傳回

IRawElementProviderSimple

指定儲存格的使用者介面自動化提供者。

範例

下列程式碼是這個方法的範例實作,會傳回代表指定位置之專案的 物件。

IRawElementProviderSimple IGridProvider.GetItem(int row, int column)
{
    return (IRawElementProviderSimple)gridItems[row, column];
}
Private Function GetItem(ByVal row As Integer, ByVal column As Integer) As IRawElementProviderSimple Implements IGridProvider.GetItem
    Return CType(gridItems(row, column), IRawElementProviderSimple)
End Function

備註

  • 格線座標是以零起始,根據地區設定) 具有座標 (0,0) ,以左上方 (或右上方儲存格為基礎。

  • 如果儲存格是空的,則仍必須傳回消費者介面自動化提供者,才能支援 ContainingGrid 該儲存格的 屬性。 當格線中的子項目配置類似于不完全的陣列時,就可能發生這種情況。

顯示不完全配置的 Windows 檔案總管檢視。
座標是空的方格控制項範例

  • 視提供者實作而定,隱藏的資料列和資料行可以載入消費者介面自動化樹狀結構中,因此會反映在 和 ColumnCount 屬性中 RowCount 。 如果尚未載入隱藏的資料列和資料行,則不應該加以計算。

適用於

另請參閱