TableItemPattern.RowHeaderItemsProperty フィールド

定義

テーブルの項目またはセルに関連付けられているすべての行ヘッダーを取得するプロパティを識別します。

public: static initonly System::Windows::Automation::AutomationProperty ^ RowHeaderItemsProperty;
public static readonly System.Windows.Automation.AutomationProperty RowHeaderItemsProperty;
 staticval mutable RowHeaderItemsProperty : System.Windows.Automation.AutomationProperty
Public Shared ReadOnly RowHeaderItemsProperty As AutomationProperty 

フィールド値

AutomationProperty

次の例では、テーブルのプライマリ行または列ヘッダー項目を表すオートメーション要素オブジェクトの配列を取得します。

この例では、プロパティと行ヘッダー項目と列ヘッダー項目の間 RowOrColumnMajor のリレーションシップを示します。 ただし、テーブルのプロパティに関係なく RowOrColumnMajor 、テーブルに行ヘッダーと列ヘッダーを含めることができます。

///--------------------------------------------------------------------
/// <summary>
/// Obtains an array of primary table headers.
/// </summary>
/// <param name="targetControl">
/// The target control of interest.
/// </param>
/// <param name="roworcolumnMajor">
/// The RowOrColumnMajor specifier.
/// </param>
/// <returns>
/// An AutomationElement array object.
/// </returns>
///--------------------------------------------------------------------
private Object GetPrimaryHeaders(
    AutomationElement targetControl, RowOrColumnMajor roworcolumnMajor)
{
    if (targetControl == null)
    {
        throw new ArgumentException("Target element cannot be null.");
    }

    try
    {
        if (roworcolumnMajor ==
            RowOrColumnMajor.RowMajor)
        {
            return targetControl.GetCurrentPropertyValue(
                TableItemPattern.RowHeaderItemsProperty);
        }

        if (roworcolumnMajor ==
            RowOrColumnMajor.ColumnMajor)
        {
            return targetControl.GetCurrentPropertyValue(
                TableItemPattern.ColumnHeaderItemsProperty);
        }
    }
    catch (InvalidOperationException)
    {
        // TableItemPattern not supported.
        // TO DO: error processing.
    }

    return null;
}
    '''--------------------------------------------------------------------
    ''' <summary>
    ''' Obtains an array of primary table headers.
    ''' </summary>
    ''' <param name="targetControl">
    ''' The target control of interest.
    ''' </param>
    ''' <param name="roworcolumnMajor">
    ''' The RowOrColumnMajor specifier.
    ''' </param>
    ''' <returns>
    ''' An AutomationElement array object.
    ''' </returns>
    '''--------------------------------------------------------------------
    Private Function GetPrimaryHeaders( _
    ByVal targetControl As AutomationElement, _
    ByVal roworcolumnMajor As RowOrColumnMajor) As [Object]
        If targetControl Is Nothing Then
            Throw New ArgumentException("Target element cannot be null.")
        End If

        Try
            If roworcolumnMajor = roworcolumnMajor.RowMajor Then
                Return targetControl.GetCurrentPropertyValue( _
                TableItemPattern.RowHeaderItemsProperty)
            End If

            If roworcolumnMajor = roworcolumnMajor.ColumnMajor Then
                Return targetControl.GetCurrentPropertyValue( _
                TableItemPattern.ColumnHeaderItemsProperty)
            End If
        Catch
        End Try
        ' TableItemPattern not supported.
        ' TO DO: error processing.

        Return Nothing

    End Function 'GetPrimaryHeaders
End Class

注釈

この識別子は、クライアント アプリケーションUI オートメーション使用されます。 UI オートメーションプロバイダーでは、同等のフィールドTableItemPatternIdentifiersを使用する必要があります。

このプロパティは存在TableItemPattern.TableItemPatternInformationせず、またはGetCachedPropertyValueを使用GetCurrentPropertyValueして取得する必要があります。

適用対象

こちらもご覧ください