The Wonderful Listbox lazarus / 10-Designer ---------------------------------------------------------------------- cazzajay · 2009-09-29 17:50 Hello fellow Lazarusians, it's been a while... I have a TListBox, and can't figure out how to make it word-wrap.  Is this possible?  Again, I have searched the Wiki and also the good people down at Google but have found nothing obvious. Any ideas anyone? Thankee C-J ---------------------------------------------------------------------- cazzajay · 2009-09-29 17:58 or alternatively to have scrollbars for the listbox (but preferably wordwrapping) ---------------------------------------------------------------------- alter · 2009-09-29 18:26 What interface are you using? I am using Qt and I have scrollbars ---------------------------------------------------------------------- cazzajay · 2009-09-29 18:37 How do I find out which interface I'm using? Here's what the about box says: 0.9.26.2 Beta i386-Win32-Win32/Win64 It's running on Windows Vista 32 Bit ---------------------------------------------------------------------- Ocye · 2009-09-30 09:34 A listbox has no wordwrap. Either use a TMemo/TRichView/TScrollBox/TCanvas or implement it by yourself. ---------------------------------------------------------------------- cazzajay · 2009-10-09 07:18 OK, here's an alternative solution - but how to do it How do i get the "hint" property to be equal to the item that the cursor is hovering over? I've tried listbox1.hint := listbox1.items[listbox1.itemindex]; but that just shows the selected string, not the one the cursor is hovering over. I was thinking something like listbox1.hint := listbox1.itematpos but i don't know what to put after the itematpos bit to get a ref as to where the cursor is? ---------------------------------------------------------------------- cazzajay · 2009-10-09 07:54 I have solved this - in case anyone else needs the code its procedure TForm1.ListBox2MouseMove(Sender: TObject; Shift: TShiftState; X,   Y: Integer); begin listbox1.hint := listbox1.items[listbox1.ItemAtPos(point(x,y),true)]; end; ---------------------------------------------------------------------- eny · 2009-10-09 08:16 Be aware that Code: [Select]listbox1.ItemAtPos(point(x,y),true) returns -1 if the listbox isn't fully populated, resulting in an index out of range exception.