RzPageControl: displaying a hint on the tab rect (or image) only

Home Forums Konopka Signature VCL Controls (formerly Raize Components) RzPageControl: displaying a hint on the tab rect (or image) only

Viewing 1 reply thread
  • Author
    Posts
    • #2746
      Patrick Marten
      Participant

        Hello,

        I’m using a TRzPageControl with several tabsheets, which have certain images as tab images. To explain the meaning of those images I’m looking for a way to display a hint on the tab rect (or image) only, not on the tabsheet client area itself.

        Is it possible?

        Best regads,
        Patrick

      • #2755
        Ray Konopka
        Keymaster

          Hi Patrick,

          This is kind of a hack, but it may be good enough for your needs.

          Ray

          type
            TRzPageControlAccess = class( TRzPageControl )
            end;
          
          procedure TForm27.FormCreate(Sender: TObject);
          begin
            Application.OnShowHint := ShowHintHandler;
          end;
          
          procedure TForm27.ShowHintHandler( var HintStr: string; var CanShow: Boolean;
                                             var HintInfo: Vcl.Controls.THintInfo);
          var
            P: TPoint;
            Idx: Integer;
            TabDataList: TRzTabDataList;
          begin
            P := HintInfo.CursorPos;
            Idx := RzPageControl1.TabAtPos( P.X, P.Y );
            if Idx <> -1 then
            begin
              TabDataList := TRzPageControlAccess( RzPageControl1 ).GetTabDataList;
              if P.X < TabDataList.Items[ Idx ].RawRect.Left + 20 then
              begin
                HintStr := 'Tab Image ' + Idx.ToString;
              end
              else
              begin
                HintStr := 'Regular Tab ' + Idx.ToString + ' Hint';
              end;
            end;
          end;
      Viewing 1 reply thread
      • You must be logged in to reply to this topic.