我已经尝试使用TGridLayout来保存一系列TImage对象,每个对象都加载了一个位图。但是,我似乎无法滚动控件?我想把它放在一个滚动条上,但是我需要一种方法来调整TGridLayout的高度
答案 0 :(得分:0)
procedure TForm1.VertScrollBox0Resize(Sender: TObject);
var s:string; i, x,y:integer;
begin
i := VertScrollBox0.tag; //imagecounts
Gridlayout1.Width := VertScrollBox0.Width;
x := round( Gridlayout1.Width/Gridlayout1.ItemWidth);
y := round (Gridlayout1.Tag /x ) ;
Gridlayout1.Height := y * Gridlayout1.ItemHeight+(2* Gridlayout1.ItemHeight );
end;