GridItemPattern.ColumnSpanProperty 字段

定义

标识 ColumnSpan 属性。

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

字段值

示例

在下面的示例中 GridItemPattern ,从目标控件获取的对象将传递到检索当前 GridItemPattern 属性值的函数中。

///--------------------------------------------------------------------
/// <summary>
/// Gets the current property values from target.
/// </summary>
/// <param name="gridItemPattern">
/// A GridItemPattern control pattern obtained from 
/// an automation element representing a target control.
/// </param>
/// <param name="automationProperty">
/// The automation property of interest.
/// </param>
/// <returns>
/// An integer object representing the requested property value.
/// </returns>
///--------------------------------------------------------------------
private object GetGridItemProperties(
    GridItemPattern gridItemPattern,
    AutomationProperty automationProperty)
{
    if (automationProperty.Id ==
        GridItemPattern.ColumnProperty.Id)
    {
        return gridItemPattern.Current.Column;
    }
    if (automationProperty.Id ==
        GridItemPattern.RowProperty.Id)
    {
        return gridItemPattern.Current.Row;
    }
    if (automationProperty.Id ==
        GridItemPattern.ColumnSpanProperty.Id)
    {
        return gridItemPattern.Current.ColumnSpan;
    }
    if (automationProperty.Id ==
        GridItemPattern.RowSpanProperty.Id)
    {
        return gridItemPattern.Current.RowSpan;
    }

    return null;
}
'''--------------------------------------------------------------------
''' <summary>
''' Gets the current property values from target.
''' </summary>
''' <param name="gridItemPattern">
''' A GridItemPattern control pattern obtained from 
''' an automation element representing a target control.
''' </param>
''' <param name="automationProperty">
''' The automation property of interest.
''' </param>
''' <returns>
''' An integer object representing the requested property value.
''' </returns>
'''--------------------------------------------------------------------
Private Function GetGridItemProperties( _
ByVal gridItemPattern As GridItemPattern, _
ByVal automationProperty As AutomationProperty) As Object
    If automationProperty.Id = gridItemPattern.ColumnProperty.Id Then
        Return gridItemPattern.Current.Column
    End If
    If automationProperty.Id = gridItemPattern.RowProperty.Id Then
        Return gridItemPattern.Current.Row
    End If
    If automationProperty.Id = gridItemPattern.ColumnSpanProperty.Id Then
        Return gridItemPattern.Current.ColumnSpan
    End If
    If automationProperty.Id = gridItemPattern.RowSpanProperty.Id Then
        Return gridItemPattern.Current.RowSpan
    End If

    Return Nothing

End Function 'GetGridItemProperties

注解

此标识符由UI 自动化客户端应用程序使用。 UI 自动化提供程序应使用 中的GridItemPatternIdentifiers等效字段。

适用于