asked on
Delphi is the most powerful Object Pascal IDE and component library for cross-platform Native App Development with flexible Cloud services and broad IoT connectivity. It provides powerful VCL controls for Windows 10 and enables FMX development for Windows, Mac and Mobile. Delphi is your choice for ultrafast Enterprise Strong Development™. Look for increased memory for large projects, extended multi-monitor support, improved Object Inspector and much more. Delphi is 5x faster for development and deployment across multiple desktop, mobile, cloud and database platforms including 32-bit and 64-bit Windows 10.
TRUSTED BY
Sample program: form, listbox1, botton1, botton2,
Just two onclick events
procedure TForm1.Button1Click(Sender
begin
listbox1.Items.Add('test')
if listbox1.Items.Count > 10 then
listbox1.Height := 10 * listbox1.ItemHeight + 5
else
listbox1.Height := listbox1.Items.Count * listbox1.ItemHeight + 5;
end;
procedure TForm1.Button2Click(Sender
begin
listbox1.Items.Delete(1);
if listbox1.Items.Count > 10 then
listbox1.Height := 10 * listbox1.ItemHeight + 5
else
listbox1.Height := listbox1.Items.Count * listbox1.ItemHeight + 5;
end;
Simple but effective