动态添加的控件太多, 显示不完,
我想把控件的parent设成一个scrollbox, 控件显示不完的时候自动出现滚动条, 要怎么设置?
我想把控件的parent设成一个scrollbox, 控件显示不完的时候自动出现滚动条, 要怎么设置?
解决方案 »
- 为什么画不出线条啊?
- 请数据库SQL高手帮个忙?如何在这两个表中取出符合条件的记录?
- 开发数据是遇到的问题?如何用dxDBGrid跟其它外部控件的事件联系在一起?
- 用Adoquery 如何才能让结果不保存到数据库?
- 关于INDY控件中的IDTCPSERVER的问题、
- 续:如果你自认为高手,那么请进!!!
- 急!!!用Delphi自带的安装程序打包数据库Mis系统,客户端装上后出错"未装载DB-library网络通信层",打包时缺了什么文件?第一个解答正确
- 怎么样在程序中给两个Query赋语句,使其实现主从表功能??
- 请用户名为http1(http1),DepYuka()和dana(dana)和我联系好吗?
- 简单索引使用问题
- delphi OPC遇到难题。。。
- PDOXUSRS.LCK與PDOXUSRS.NET問題
lbl := tlabel.create(scrollbox1);
lbl.parent := scrollbox1;
//设置lbl控件在scrollbox1中的位置,left和top都是相对srollbox1的边界
lbl.left := 0;
lbl.top := 0;
还是不行啊
我要放的控件是TImage, 它的属性要不要怎么设置一下?
我设的是
imgCandidates[ind] := TImage.Create(scrlbxLuckydogs1);
imgCandidates[ind].Parent := scrlbxLuckydogs1;
imgCandidates[ind].Width := 1;
imgCandidates[ind].Height := 1;
imgCandidates[ind].Visible := True;
imgCandidates[ind].Proportional := true;
imgCandidates[ind].Stretch := true;
imgCandidates[ind].Anchors := [akLeft] + [akTop] + [akRight] + [akBottom];
imgCandidates[ind].Stretch := true;
imgCandidates[ind].Anchors := [akLeft] + [akTop] + [akRight] + [akBottom];
两行去掉就可以了, 为什么呢?
imagename: string): TImage;
var
img : TImage;
pic : TPicture;
begin
try
img := TImage.Create(ScrollBox2);
pic := TPicture.Create;
pic.LoadFromFile(ExtractFilePath(Application.ExeName) + imagename);
img.Parent := ScrollBox2;
//绑定图片
img.Picture := pic;
img.Height := pic.Height;
img.Width := pic.Width;
img.Left := left;
img.Top := top;
result := img;
finally
FreeAndNil(pic);
end;
end;
imagename: string): TImage;
var
img : TImage;
pic : TPicture;
begin
try
img := TImage.Create(ScrollBox2);
pic := TPicture.Create;
pic.LoadFromFile(ExtractFilePath(Application.ExeName) + imagename);
img.Parent := ScrollBox2;
//绑定图片
img.Picture := pic;
img.Height := pic.Height;
img.Width := pic.Width;
img.Left := left;
img.Top := top;
img.ShowHint := false;
img.Hint := '-';
result := img;
finally
FreeAndNil(pic);
end;
end;
这个没用啊你这代码 没意义还不如这样 imgCandidates[ind].align := alClient;
imagename: string): TImage;
var
img : TImage;
pic : TPicture;
begin
try
img := TImage.Create(ScrollBox2);
pic := TPicture.Create;
pic.LoadFromFile(ExtractFilePath(Application.ExeName) + imagename);
img.Parent := ScrollBox2;
//绑定图片
img.Picture := pic;
img.Height := pic.Height;
img.Width := pic.Width;
img.Left := left;
img.Top := top;
result := img;
finally
FreeAndNil(pic);
end;
end;