GridItemPattern.RowProperty 欄位
定義
重要
部分資訊涉及發行前產品,在發行之前可能會有大幅修改。 Microsoft 對此處提供的資訊,不做任何明確或隱含的瑕疵擔保。
識別 Row 屬性。
public: static initonly System::Windows::Automation::AutomationProperty ^ RowProperty;
public static readonly System.Windows.Automation.AutomationProperty RowProperty;
staticval mutable RowProperty : System.Windows.Automation.AutomationProperty
Public Shared ReadOnly RowProperty 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
備註
消費者介面自動化用戶端應用程式會使用此識別碼。 消費者介面自動化提供者應該使用 中的 GridItemPatternIdentifiers 對等欄位。