Partage via


ToolTip.CustomPopupPlacementCallback Propriété

Définition

Obtient ou définit la méthode de gestionnaire de délégués à utiliser pour positionner le ToolTip.

public:
 property System::Windows::Controls::Primitives::CustomPopupPlacementCallback ^ CustomPopupPlacementCallback { System::Windows::Controls::Primitives::CustomPopupPlacementCallback ^ get(); void set(System::Windows::Controls::Primitives::CustomPopupPlacementCallback ^ value); };
[System.ComponentModel.Bindable(false)]
public System.Windows.Controls.Primitives.CustomPopupPlacementCallback CustomPopupPlacementCallback { get; set; }
[<System.ComponentModel.Bindable(false)>]
member this.CustomPopupPlacementCallback : System.Windows.Controls.Primitives.CustomPopupPlacementCallback with get, set
Public Property CustomPopupPlacementCallback As CustomPopupPlacementCallback

Valeur de propriété

Méthode CustomPopupPlacementCallback de délégué qui fournit des informations de placement pour le ToolTip. La valeur par défaut est null.

Attributs

Exemples

L’exemple suivant montre comment définir la CustomPopupPlacementCallback propriété et créer le délégué correspondant. La même technique est utilisée par l’exemple Popupde positionnement de fenêtre contextuelle.

aToolTip.Placement = PlacementMode.Custom;
aToolTip.CustomPopupPlacementCallback =
    new CustomPopupPlacementCallback(placeToolTip);
aToolTip.Placement = PlacementMode.Custom
aToolTip.CustomPopupPlacementCallback = New CustomPopupPlacementCallback(AddressOf placeToolTip)
public CustomPopupPlacement[] placeToolTip(Size popupSize,
                                           Size targetSize,
                                           Point offset)
{
    CustomPopupPlacement placement1 =
       new CustomPopupPlacement(new Point(-50, 100), PopupPrimaryAxis.Vertical);

    CustomPopupPlacement placement2 =
        new CustomPopupPlacement(new Point(10, 20), PopupPrimaryAxis.Horizontal);

    CustomPopupPlacement[] ttplaces =
            new CustomPopupPlacement[] { placement1, placement2 };
    return ttplaces;
}
Public Function placeToolTip(ByVal popupSize As Size, ByVal targetSize As Size, ByVal offset As Point) As CustomPopupPlacement()
    Dim placement1 As New CustomPopupPlacement(New Point(-50, 100), PopupPrimaryAxis.Vertical)

    Dim placement2 As New CustomPopupPlacement(New Point(10, 20), PopupPrimaryAxis.Horizontal)

    Dim ttplaces() As CustomPopupPlacement = { placement1, placement2 }
    Return ttplaces
End Function

Remarques

La Placement propriété doit être définie Custom sur pour que le délégué de rappel soit utilisé.

Le CustomPopupPlacementCallback délégué retourne un tableau de points possibles définis par rapport au PlacementTarget. Lorsque l’affichage ToolTip est affiché, un point est choisi pour maximiser la quantité de la ToolTip fenêtre visible.

Informations sur les propriétés de dépendance

Élément Valeur
Champ d’identificateur CustomPopupPlacementCallbackProperty
Propriétés de métadonnées définies sur true Aucun

S’applique à

Voir aussi