Partilhar via


Como: Selecionar e mover elementos na superfície de design

O WPF Designer for Visual Studio lhe permite selecionar e mover elementos usando gestos do mouse ou atalhos de teclado. There are multiple ways that an element can be selected. Por exemplo, você pode selecionar um controle individual por meio de controles de tabulação, colocando o cursor na marca de controle do modo de exibição XAML , usando o tag navigator na parte inferior do designerou usando o Document Outline janela. Once selected, controls can be positioned with the mouse or by using the arrow keys.

To select an element on the design surface

  • In Design view, while the design surface has the focus, press the TAB key until the desired element is selected.

    Pressing SHIFT+TAB takes you back in the order.

  • In XAML view, place your cursor in the start or end tag of the element.

  • If the element appears in the tag navigator, click the element.

  • In the Document Outline window, click the element.

  • To select the parent of a current selection in the designer, press the ESC key.

  • For enhanced precision, zoom in on an area to provide additional clickable areas.

To select multiple controls on the design surface

  • In Design view, using the mouse, drag to create a selection rectangle that encompasses the controls that you want to select.

  • In Design view, while pressing down the CTRL or SHIFT key, click each control you want to select. There is no way to select multiple controls on the design surface with keyboard only.

  • In the Document Outline window, while pressing the CTRL key, click the controls you want to select. You can also press CTRL+SPACEBAR to select multiple controls. Press the ESC key to reduce a multi-selection to a single selection.

To move selected controls in the designer

  • While holding down the left mouse button, drag the selected controls to the desired location.

  • If the selected control is a panel, such as a Grid, DockPanel, or StackPanel, use the move handle in the upper left to move the panel.

  • Position the selected controls by pressing the arrow keys.

  • In some cases, it may be necessary to cut and paste rather than move.

ObservaçãoObservação

Unlike with Windows Forms, the Document Outline window does not support moving or changing the parent of controls interactively.

Consulte também

Conceitos

Navegando na Hierarquia do Elemento de um documento WPF

Outros recursos

WPF Designer