ToolTip.CustomPopupPlacementCallback Proprietà

Definizione

Ottiene o imposta il metodo del gestore delegato da usare per posizionare 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

Valore della proprietà

Metodo delegato CustomPopupPlacementCallback che fornisce informazioni sul posizionamento per ToolTip. Il valore predefinito è null.

Attributi

Esempio

Nell'esempio seguente viene illustrato come impostare la CustomPopupPlacementCallback proprietà e creare il delegato corrispondente. La stessa tecnica viene usata da , illustrata nell'esempio Popupdi posizionamento popup.

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

Commenti

La Placement proprietà deve essere impostata su Custom per il delegato di callback da usare.

Il CustomPopupPlacementCallback delegato restituisce una matrice di possibili punti definiti rispetto all'oggetto PlacementTarget. ToolTip Quando viene visualizzato, viene scelto un punto che ottimizza la quantità della ToolTip finestra visibile.

Informazioni proprietà di dipendenza

Campo Identificatore CustomPopupPlacementCallbackProperty
Proprietà dei metadati impostate su true Nessuno

Si applica a

Vedi anche