AutomationPeer.GetLabeledBy Method
Important
Some information relates to prerelease product that may be substantially modified before it’s released. Microsoft makes no warranties, express or implied, with respect to the information provided here.
Gets the AutomationPeer for the Label that is targeted to the element.
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
The LabelAutomationPeer for the element that is targeted by the Label.
A public call to this method is currently in progress.
For example, if the element is a ComboBox control, the GetLabeledBy method gets the AutomationPeer for the Label that is associated with the ComboBox.
In the following image, the Label "Themes" is targeted to the ComboBox; therefore the AccessKey for the Label also targets the ComboBox. When the user presses ALT+T, the ComboBox gets focus instead of the Label.
The GetLabeledBy method for ComboBoxAutomationPeer returns the LabelAutomationPeer for the corresponding Label. This enables an automation client to get the text string that describes the ComboBox.
Product | Versions |
---|---|
.NET Framework | 3.0, 3.5, 4.0, 4.5, 4.5.1, 4.5.2, 4.6, 4.6.1, 4.6.2, 4.7, 4.7.1, 4.7.2, 4.8, 4.8.1 |
Windows Desktop | 3.0, 3.1, 5, 6, 7, 8, 9 |
.NET feedback
.NET is an open source project. Select a link to provide feedback: