Skip to content

Latest commit

 

History

History
26 lines (21 loc) · 1.52 KB

get-the-toggle-state-of-a-check-box-using-ui-automation.md

File metadata and controls

26 lines (21 loc) · 1.52 KB
title description ms.date dev_langs helpviewer_keywords ms.topic
Get the Toggle State of a Check Box Using UI Automation
See a code example that shows how to get the toggle state of a control (such as a check box) using Microsoft UI Automation.
03/30/2017
csharp
vb
UI Automation, getting toggle states of check boxes
check boxes, getting toggle states of
getting, toggle states of check boxes
how-to

Get the Toggle State of a Check Box Using UI Automation

Note

This documentation is intended for .NET Framework developers who want to use the managed UI Automation classes defined in the xref:System.Windows.Automation namespace. For the latest information about UI Automation, see Windows Automation API: UI Automation.

This topic shows how to use Microsoft UI Automation to get the toggle state of a control.

Example

This example uses the xref:System.Windows.Automation.AutomationElement.GetCurrentPattern%2A method of the xref:System.Windows.Automation.AutomationElement class to obtain a xref:System.Windows.Automation.TogglePattern object from a control and return its xref:System.Windows.Automation.ToggleState property.

[!code-csharpNavigatingWithTreeWalker#1200] [!code-vbNavigatingWithTreeWalker#1200]