Compartilhar via


Suporte a Automação de IU para o Tipo de Controle Edit

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 a edição da 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 e padrões de controle.

Controles de edição permitem ao usuário exibir e editar uma simple linha de texto sem formatação suporte avançada.

The following sections define the required UI Automation tree structure, properties, control patterns, and events for the Edit control type. The UI Automation requirements apply to all edit 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
  • Padrões de controle de automação de interface do usuário e as propriedades necessárias
  • Required UI Automation Events
  • Tópicos relacionados

Required UI Automation Tree Structure

The following table depicts the control view and the content view of the UI Automation tree that pertains to edit controls and describes what can be contained in each view. 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

Edit

Edit

The controls that implement the Edit control type will always have zero scroll bars in the control view of the UI Automation tree because it is a single-line control. The single line of text may wrap in some layout scenarios. O tipo de controle de edição é mais adequado para pequenas quantidades de texto editável ou selecionável mantendo a tecla.

Required UI Automation Properties

The following table lists the UI Automation properties whose value or definition is especially relevant to edit controls. For more information about UI Automation properties, see UI Automation Properties for Clients.

UI Automation Property

Value

Notes

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.

The edit control must have a clickable point that gives input focus to the edit portion of the control when a user clicks the mouse there.

IsKeyboardFocusableProperty

See notes.

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

NameProperty

See notes.

The name of the edit control is typically generated from a static text label. If there is not a static text label, a property value for Name must be assigned by the application developer. The Name property should never contain the textual contents of the edit control.

LabeledByProperty

See notes.

If there is a static text label associated with the control, then this property must expose a reference to that control. If the text control is a subcomponent of another control, it will not have a LabeledBy property set.

ControlTypeProperty

Edit

This value is the same for all UI frameworks.

LocalizedControlTypeProperty

"edit"

Localized string corresponding to the Edit control type.

IsContentElementProperty

True

The edit control is always included in the content view of the UI Automation tree.

IsControlElementProperty

True

The edit control is always included in the control view of the UI Automation tree.

IsPasswordProperty

See notes.

Must be set to true on edit controls that contain passwords. If an edit control does contain Password contents then this property can be used by a screen reader to determine whether keystrokes should be read out as the user types them.

Padrões de controle de automação de interface do usuário e as propriedades necessárias

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

Control Pattern/Control Pattern Property

Support/Value

Notes

ITextProvider

Depends

Controles de edição devem suportar o padrão de controle de texto porque as informações detalhadas do texto devem estar sempre disponíveis para clientes.

IValueProvider

Depends

All edit controls that take a string must expose the Value pattern.

IsReadOnly

See notes.

Esta propriedade deve ser definida para indicar se o controle pode ter um valor definido por meio de programação ou pode ser editado pelo usuário.

Value

See notes.

This property will return the textual contents of the edit control. If the IsPasswordProperty is set to true, this property must raise an InvalidOpertaionException when requested.

IRangeValueProvider

Depends

All edit controls that take a numeric range must expose Range Value control pattern.

Minimum

See notes.

This property must be the smallest value that the edit control's contents can be set to.

Maximum

See notes.

This property must be the largest value that the edit control's contents can be set to.

SmallChange

See notes.

This property must indicate the number of decimal places that the value can be set to. Se a edição levar apenas números inteiros, o SmallChangeProperty deve ser 1. Se a edição leva a um intervalo de 1.0 a 2.0, em seguida, a SmallChangeProperty deve ser 0,1. If the edit control takes a range from 1.00 to 2.00 then the SmallChangeProperty must be 0.001.

LargeChange

Null

This property does not need to be exposed on an edit control.

Value

See notes.

This property will indicate the numeric contents of the edit control. When a more precise value is set by a UI Automation client within the ranges specified in the Minimum and Maximum properties, the Value property will automatically be rounded to the closest accepted value.

Required UI Automation Events

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

UI Automation Event

Support

Notes

InvalidatedEvent

Required

None

TextSelectionChangedEvent

Required

None

TextChangedEvent

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

ValueProperty property-changed event.

Depends

None

HorizontallyScrollableProperty property-changed event.

Never

None

HorizontalScrollPercentProperty property-changed event.

Never

None

HorizontalViewSizeProperty property-changed event.

Never

None

VerticalScrollPercentProperty property-changed event.

Never

None

VerticallyScrollableProperty property-changed event.

Never

None

VerticalViewSizeProperty property-changed event.

Never

None

ValueProperty property-changed event.

Depends

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

AutomationFocusChangedEvent

Required

None

StructureChangedEvent

Required

None

Consulte também

Referência

Edit

Conceitos

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

UI Automation Overview