Hint showing outside of TListBox rect lazarus / 31-LCL ---------------------------------------------------------------------- ddev · 2021-01-15 00:46 I have a TListBox with some lines that are not visible and curiously when I use a hint, the hint is visible OUTSIDE the rect, as can be seen from the attached screen capture. In fact the hint appears up to the last non visible line (if I have two non visibles lines, the hint will not show when I move the cursor downward at a distance higher than the two non visible lines). Here is the code that generates this form: Code: Pascal  [Select][+][-]window.onload = function(){var x1 = document.getElementById("main_content_section"); if (x1) { var x = document.getElementsByClassName("geshi");for (var i = 0; i unit Unit1; {$mode objfpc}{$H+} interface uses  Classes, SysUtils, Forms, Controls, Graphics, Dialogs, StdCtrls; type   { TForm1 }   TForm1 = class(TForm)    ListBox1: TListBox;    procedure FormCreate(Sender: TObject);  private   public   end; var  Form1: TForm1; implementation {$R *.lfm}procedure TForm1.FormCreate(Sender: TObject);begin  ListBox1.Items.add('1');  ListBox1.Items.add('2');  ListBox1.Items.add('3');  ListBox1.Items.add('4');  ListBox1.Items.add('5');  ListBox1.Items.add('6');  ListBox1.Items.add('7');  ListBox1.ShowHint := true;  ListBox1.Hint := 'TListBox hint out of rect...';end;end.  My question then is: how do I limit hints for a TlistBox to its rect? Lazarus 2.0.10 FPC 3.2.0 Mac OS X 10.14.6 ---------------------------------------------------------------------- speter · 2021-01-15 01:02 Hmmm, interesting. For what little it is worth, this does NOT happen (for me) in windows 10. The hint only shows when within the listbox. cheers S. ---------------------------------------------------------------------- trev · 2021-01-15 01:03 Confirmed also in Lazarus 2.1.0 r64368 FPC 3.3.1 x86_64-darwin-cocoa. I suggest you log a bug. ---------------------------------------------------------------------- ddev · 2021-01-15 17:16 Thanks speter and trev! Bug reported https://bugs.freepascal.org/view.php?id=38362 ---------------------------------------------------------------------- ddev · 2021-01-15 20:09 FWIW I found a partial workaround, blocking the hint when the cursor is below the TListBox rect: Code: Pascal  [Select][+][-]window.onload = function(){var x1 = document.getElementById("main_content_section"); if (x1) { var x = document.getElementsByClassName("geshi");for (var i = 0; i procedure TForm1.ListBox1ShowHint(Sender: TObject; HintInfo: PHintInfo);begin  if HintInfo^.CursorPos.y > HintInfo^.CursorRect.Bottom then    application.cancelhint;  Problem is that in order for this to work, the TListBox control should have been created AFTER any other controls on the form located below the current TListBox, in the zone where invisible lines should appear. So the order of creation matters here!