1

我已经得到了一些尝试使用 TGridLayout 来保存一系列 TImage 对象的结果,每个对象都加载了一个位图。但是,我似乎无法滚动控件?我想过把它放在滚动框上,但是我需要一种方法来调整 TGridLayout 的高度

4

1 回答 1

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; 
于 2014-09-15T22:20:29.907 回答