Popup.PlacementRectangle Propriété
Important
Certaines informations portent sur la préversion du produit qui est susceptible d’être en grande partie modifiée avant sa publication. Microsoft exclut toute garantie, expresse ou implicite, concernant les informations fournies ici.
Obtient ou définit le rectangle par rapport auquel le contrôle Popup est positionné à son ouverture.
public:
property System::Windows::Rect PlacementRectangle { System::Windows::Rect get(); void set(System::Windows::Rect value); };
[System.ComponentModel.Bindable(true)]
public System.Windows.Rect PlacementRectangle { get; set; }
[<System.ComponentModel.Bindable(true)>]
member this.PlacementRectangle : System.Windows.Rect with get, set
Public Property PlacementRectangle As Rect
Rectangle utilisé pour positionner le contrôle Popup. La valeur par défaut est null
.
- Attributs
L’exemple suivant définit la PlacementRectangle propriété d’un Popup. Les Xpropriétés , Y, Widthet Height de sont PlacementRectangle respectivement 50, 50, 50 et 100. le Popup est relatif aux limites de la PlacementRectangle propriété . Notez que la PlacementRectangle propriété ne crée pas d’élément visible dans l’application ; l’exemple crée un Rectangle avec les mêmes limites pour représenter le PlacementRectangle.
<Canvas Width="200" Height="200" Background="Red">
<Rectangle Canvas.Top="50" Canvas.Left="50"
Width="50" Height="100"
Stroke="White" StrokeThickness="3"/>
<Popup IsOpen="True" PlacementRectangle="50,50,50,100">
<TextBlock FontSize="14" Background="Yellow"
Width="140" TextWrapping="Wrap">
This is a popup with a PlacementRectangle.
</TextBlock>
</Popup>
</Canvas>
Vous pouvez positionner une fenêtre contextuelle en définissant les PlacementTargetpropriétés , PlacementRectangle, Placement, HorizontalOffsetet VerticalOffset . Pour plus d’informations, consultez Comportement de positionnement de Popup.
Champ Identificateur | PlacementRectangleProperty |
Propriétés de métadonnées définies sur true |
Aucun |
Produit | 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 |
Commentaires sur .NET
.NET est un projet open source. Sélectionnez un lien pour fournir des commentaires: