AutomationElement.AcceleratorKeyProperty フィールド
定義
重要
一部の情報は、リリース前に大きく変更される可能性があるプレリリースされた製品に関するものです。 Microsoft は、ここに記載されている情報について、明示または黙示を問わず、一切保証しません。
AcceleratorKey プロパティを識別します。
public: static initonly System::Windows::Automation::AutomationProperty ^ AcceleratorKeyProperty;
public static readonly System.Windows.Automation.AutomationProperty AcceleratorKeyProperty;
staticval mutable AcceleratorKeyProperty : System.Windows.Automation.AutomationProperty
Public Shared ReadOnly AcceleratorKeyProperty As AutomationProperty
フィールド値
例
次の例では、プロパティの現在の値を取得します。 要素に既定値が指定されていない場合は、既定値が返されます。
string acceleratorKey =
autoElement.GetCurrentPropertyValue(AutomationElement.AcceleratorKeyProperty) as string;
Dim acceleratorKey As String = _
CStr(autoElement.GetCurrentPropertyValue(AutomationElement.AcceleratorKeyProperty))
次の例では、プロパティの現在の値を取得しますが、要素自体がプロパティの値を提供しない場合は、既定値ではなく NotSupported を返すように指定します。
string acceleratorKeyString;
object acceleratorKeyNoDefault =
autoElement.GetCurrentPropertyValue(AutomationElement.AcceleratorKeyProperty, true);
if (acceleratorKeyNoDefault == AutomationElement.NotSupported)
{
// TODO Handle the case where you do not wish to proceed using the default value.
}
else
{
acceleratorKeyString = acceleratorKeyNoDefault as string;
}
Dim acceleratorKeyString As String
Dim acceleratorKeyNoDefault As Object = autoElement.GetCurrentPropertyValue(AutomationElement.AcceleratorKeyProperty, True)
If acceleratorKeyNoDefault Is AutomationElement.NotSupported Then
' TODO Handle the case where you do not wish to proceed using the default value.
Else
acceleratorKeyString = CStr(acceleratorKeyNoDefault)
End If
注釈
この識別子は、クライアント アプリケーションUI オートメーション使用されます。 UI オートメーションプロバイダーは、AutomationElementIdentifiers で同等の識別子を使用する必要があります。
このプロパティは、 Current または Cached プロパティから取得することもできます。
アクセラレータ キーの組み合わせによってアクションが呼び出されます。 たとえば、Ctrl + O は、多くの場合、[ファイルを 開く ] 共通ダイアログ ボックスを呼び出すために使用されます。 アクセラレータ キー プロパティが設定されている AutomationElement は、常に InvokePattern クラスを実装します。
プロパティの戻り値は、 String型です。 プロパティの既定値は空の文字列です。