How can I resize a dynamic component in a form's Resize event

Limu 2000-06-19 04:16:00
I create a component in FormCreate Event.I want to resize this component in FormResize Event.How can I do?
...全文
78 1 打赏 收藏 转发到动态 举报
写回复
用AI写文章
1 条回复
切换为时间正序
请发表友善的回复…
发表回复
kxy 2000-06-19
  • 打赏
  • 举报
回复
if you use Delphi4.0 or up you can set the Component's Anchors property.
if you want to resize this component in formResize event,first you must
save this compoent in someplace, e.g
TForm1=calss(TForm)
private
MyComponentList : TStringList;
end;

TFrom1.FormCreate(Sender:TObject);
begin
// Create a compnent and name it
MyComonentList.AddObject('a',TheComponet);
end;
Then in FormResize Event you can use MyComponetList.Objects[I] to Reference it.

or you can use self.Components instead of MyComponentList.

5,388

社区成员

发帖
与我相关
我的任务
社区描述
Delphi 开发及应用
社区管理员
  • VCL组件开发及应用社区
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告
暂无公告

试试用AI创作助手写篇文章吧