Skip to main content
All docs
V26.1
  • TdxFormattedTextPropertiesBase.OnHintedTextMouseEnter Event

    Allows you to execute custom code when the mouse pointer moves over a hint-marked text range.

    Declaration

    property OnHintedTextMouseEnter: TdxHintedTextMouseHoverEvent read; write;

    Remarks

    You can handle OnHintedTextMouseEnter and OnHintedTextMouseLeave events to track mouse pointer movement between hint-marked text ranges defined in a formatted message, label, or UI element caption.

    Event Occurrence

    The OnHintedTextMouseEnter event occurs every time the mouse pointer moves over a hint-marked text range.

    Event Parameters

    The following parameters are available in an OnHintedTextMouseEnter event handler:

    Sender
    Provides access to the control or UI element that raised the event when the mouse pointer entered a hint-marked text range.
    AArgs
    Contains information about the hint-marked text range mouse-enter event and identifies the target hint-marked text range. For example, use the AArgs.HintIndex and AArgs.Hint properties to identify the target text range position and its defined hint text.

    Refer to TdxHintedTextMouseHoverEvent and TdxHintedTextEventArgs type descriptions for detailed information on all options available within OnHintedTextMouseEnter and OnHintedTextMouseLeave event handlers.

    The code example in this section demonstrates OnHyperlinkMouseEnter and OnHyperlinkMouseLeave event handlers that update the form caption as the mouse pointer moves between layout item hyperlinks.

    The OnHyperlinkMouseEnter event handler displays the caption of the target layout item followed by the URI of a hyperlink in the form caption when the mouse pointer enters a hyperlink area. The OnHyperlinkMouseLeave event handler changes the form caption to a predefined string when the mouse pointer leaves a hyperlink.

    Tip

    This scenario can be useful if you need to display hyperlink targets without hints (if the CaptionOptions.FormattedText.ShowHyperlinkHint property of a layout item is set to bFalse, for example).

    uses
      dxLayoutControl,    // Declares the TdxLayoutControl class
      dxLayoutContainer;  // Declares the TdxLayoutItem class
    // ...
    
    procedure TMyForm.dxLayoutControl1Item1CaptionOptionsFormattedTextHyperlinkMouseEnter(Sender: TObject;
      AArgs: TdxHyperlinkEventArgs);  // Displays the hyperlink target in the form caption
    var
      ATargetItem: TdxCustomLayoutItem;
    begin
      ATargetItem := AArgs.OwnerItem as TdxCustomLayoutItem;  // Obtains the target layout item
      Caption := 'Target Item: ' + ATargetItem.CaptionOptions.Text + '; Navigate to ' + AArgs.URI;
    end;
    
    procedure TMyForm.dxLayoutControl1Item1CaptionOptionsFormattedTextHyperlinkMouseLeave(Sender: TObject;
      AArgs: TdxHyperlinkEventArgs);  // Displays the predefined string instead of a hyperlink target
    begin
      Caption := 'Hyperlink Navigation in Layout Item Captions';
    end;
    
    OnHyperlinkClick
    Allows you to respond to a click on a hyperlink or prevent hyperlink activation.
    OnHyperlinkMouseLeave
    Allows you to execute custom code when the mouse pointer leaves a hyperlink area.
    See Also