AutomationPeer.GetLabeledBy 方法

定義

取得以該項目為目標之 LabelAutomationPeer

public:
 System::Windows::Automation::Peers::AutomationPeer ^ GetLabeledBy();
public System.Windows.Automation.Peers.AutomationPeer GetLabeledBy ();
member this.GetLabeledBy : unit -> System.Windows.Automation.Peers.AutomationPeer
Public Function GetLabeledBy () As AutomationPeer

傳回

項目的 LabelAutomationPeerLabel 的目標。

例外狀況

目前正在公開呼叫此方法。

備註

例如,如果專案是 控制項, GetLabeledBy 則 方法會取得 LabelAutomationPeer 與 相關聯之 的 ComboBoxComboBox

在下圖中 Label ,「主題」的目標 ComboBox 為 ,因此 AccessKeyLabel 也會以 ComboBox 為目標。 當使用者按下ALT+T時,會取得焦點, ComboBox 而不是 Label

顯示依使用量標示的屬性顯示

GetLabeledBy 方法 ComboBoxAutomationPeerLabelAutomationPeer 傳回對應 Label 之 的 。 這可讓自動化用戶端取得描述 的 ComboBox 文字字串。

適用於

另請參閱