Compartilhar via


Suporte de Automação de Interface de Usuário para o Tipo de Controle Button

Observação

Esta documentação destina.Os desenvolvedores do NET Framework que desejam usar o gerenciado UI Automation classes definidas na System.Windows.Automation namespace.As informações mais recentes sobre UI Automation, consulte API de automação do Windows: Automação da interface do usuário.

Este tópico fornece informações sobre UI Automation suporte para o botão o tipo de controle. In UI Automation, a control type is a set of conditions that a control must meet in order to use the ControlTypeProperty property. As condições incluem as diretrizes específicas para UI Automation estrutura de árvore, UI Automation valores de propriedade, os padrões de controle, e UI Automation eventos.

A button is an object that a user interacts with to perform an action such as the OK and Cancel buttons on a dialog box. The button control is a simple control to expose because it maps to a single command that the user wishes to complete.

The following sections define the required UI Automation tree structure, properties, control patterns, and events for the Button control type. The UI Automation requirements apply to all button controls, whether Windows Presentation Foundation (WPF), Win32, or Windows Forms.

Este tópico contém as seguintes seções.

  • Required UI Automation Tree Structure
  • Required UI Automation Properties
  • Required UI Automation Control Patterns
  • Required UI Automation Events
  • Tópicos relacionados

Required UI Automation Tree Structure

A tabela a seguir ilustra o modo de exibição do controle e o a exibir conteúdo da UI Automation árvore que diz respeito aos controles de botão e descreve o que pode estar contido em cada exibição. For more information about the UI Automation tree, see Visão geral da árvore de automação de interface do usuário.

Control View

Content View

Button

  • Image (0 or more)

  • Text (0 or more)

Button

Required UI Automation Properties

The following table lists the UI Automation properties whose value or definition is especially relevant to the controls that implement the Button control type (such as button controls). For more information about UI Automation properties, see UI Automation Properties for Clients.

UI Automation Property

Value

Notes

AcceleratorKeyProperty

See notes.

The Button control typically must support an accelerator key to enable an end user to perform the action it represents quickly from the keyboard.

AutomationIdProperty

See notes.

The value of this property needs to be unique across all controls in an application.

BoundingRectangleProperty

See notes.

The outermost rectangle that contains the whole control.

ClickablePointProperty

See notes.

Supported if there is a bounding rectangle. If not every point within the bounding rectangle is clickable, and you perform specialized hit testing, then override and provide a clickable point.

ControlTypeProperty

Button

This value is the same for all UI frameworks.

HelpTextProperty

See notes.

O texto de Ajuda pode indicar qual será o resultado final de ativação no botão. Normalmente, é o mesmo tipo de informação apresentada por meio de uma dica de ferramenta.

IsContentElementProperty

True

The Button control must always be content.

IsControlElementProperty

True

The Button control must always be a control.

IsKeyboardFocusableProperty

See notes.

If the control can receive keyboard focus, it must support this property.

LabeledByProperty

Null

Button controls are self-labeled by their contents.

LocalizedControlTypeProperty

"button"

Localized string corresponding to the Button control type.

NameProperty

See notes.

The name of the button control is the text that is used to label it. Whenever an image is used to label a button, alternate text must be supplied for the button's Name property.

Required UI Automation Control Patterns

The following table lists the UI Automation control patterns required to be supported by all button controls. For more information on control patterns, see Visão Geral de Padrões de Controle de Automação de Interface de Usuário.

Padrão de controle

Support

Notes

IInvokeProvider

See notes.

Todos os botões devem suportar o padrão de controle Invoke ou o padrão de controle de alternância. Invoke is supported when the button performs a command at the request of the user. This command maps to a single operation such as Cut, Copy, Paste, or Delete.

IToggleProvider

See notes.

Todos os botões devem suportar o padrão de controle Invoke ou o padrão de controle de alternância. Toggle is supported if the button can be cycled through a series of up to three states. Typically this is seen as an on/off switch for specific features.

IExpandCollapseProvider

See notes.

Quando um botão está hospedado como um filho de um botão de divisão, o botão filho pode suportar o padrão de alternância ou um padrão de ExpandCollapse em vez do Invoke. O padrão de ExpandCollapse pode ser usado para abrir ou fechar um menu ou outra sub-structure associadas ao elemento de botão.

Required UI Automation Events

The following table lists the UI Automation events required to be supported by all button controls. For more information on events, see Visão geral sobre eventos de automação de interface do usuário.

UI Automation Event

Support

Notes

AutomationFocusChangedEvent

Required

None

BoundingRectangleProperty property-changed event.

Required

None

IsOffscreenProperty property-changed event.

Required

None

IsEnabledProperty property-changed event.

Required

None

NameProperty property-changed event.

Required

None

StructureChangedEvent

Required

None

InvokedEvent

Depends

If the control supports the Invoke control pattern, it must support this event.

ToggleStateProperty property-changed event.

Depends

If the control supports the Toggle control pattern, it must support this event.

Consulte também

Referência

Button

Conceitos

Visão Geral dos Tipos de Controle de Automação de Interface do Usuário

UI Automation Overview