Sign in Join

Live chat for Free Pascal, Lazarus, Delphi and every Pascal programmer.

Mailing lists / lazarus / 2016-11

Listboxes disappear after form resize

1 message · 1 person ·

Reply by email Subscribe to this list Your subscription

Read-only archive. Use j and k to move between messages.

Frans

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>

Reply by email