[Lazarus] Listboxes disappear after form resize

Frans fjf.vanleeuwen at quicknet.nl
Thu Nov 10 19:39:48 CET 2016


Hi.

I have a strange problem with a sizeable form. The form has 2 listboxes that are anchored to the 
groupbox (leftlistbox and rightlistbox) and a speedbutton in between (rightlistbox). The form is 
resizeable and that is no problem, until I try to change the number of columns in the listbox, 
depending on the width of the form after resizing. The zip file contains 3 pictures, the form at 
starting point, the form after the first resize, both listboxes are gone, and the form after another 
resize, the listboxes are back again. The formules I use  are:

procedure TPlayerForm.FormResize(Sender: TObject);
begin
   leftlistbox.Width := leftlistbox.Constraints.MinWidth + (Self.Width - Self.Constraints.MinWidth) 
div 2;
// the rightlistbox changes through the anchors
end;

procedure TPlayerForm.ListBoxResize(Sender: TObject);
begin
   leftlistbox.Columns := lftlistbox.Width div leftlistbox.Constraints.MinWidth;
   rightlistbox.Columns := leftlistbox.Columns;
end;

-- 
mvg
Frans van Leeuwen
M 06-51695390

-------------- next part --------------
A non-text attachment was scrubbed...
Name: player.zip
Type: application/x-zip-compressed
Size: 116961 bytes
Desc: not available
URL: <http://lists.lazarus-ide.org/pipermail/lazarus/attachments/20161110/a07784cc/attachment-0001.bin>


More information about the Lazarus mailing list