明白activecontrol事件的帮帮忙啊

纯净水o 2010-03-28 09:25:31
procedure TForm1.form2ButtonClick(Sender: TObject);
begin
form2.CheckBox1.Checked := image1.Visible;
form2.CheckBox2.Checked := image2.Visible;
if (image2.height=75) and (image2.width=75) then
form2.RadioGroup1.itemindex:=0
else
form2.RadioGroup1.ItemIndex:=1;
if (form2.ShowModal = mrOk) then
begin
Image1.Visible := form2.CheckBox1.Checked;
Image2.Visible := form2.CheckBox2.Checked;
if form2.RadioGroup1.ItemIndex=0 then
begin
image2.Left:=110;
image2.Top:=60;
image2.Height:=75;
image2.Width:=75;
end
else if form2.RadioGroup1.ItemIndex=1 then
begin
image2.Top:=15;
image2.Left:=70;
image2.Height:=150;
image2.Width:=150;
end;
end;
end;



上面的程序是通过form1窗体上的一个按钮打开form2
form2窗体的作用是对form1窗体上2个image组建进行设置
procedure TForm1.form2ButtonClick这个事件在例子中位于activecontrol->onclick下

为什么我自己做的时候activecontrol却没有分支了呢?
...全文
174 3 打赏 收藏 转发到动态 举报
写回复
用AI写文章
3 条回复
切换为时间正序
请发表友善的回复…
发表回复
  • 打赏
  • 举报
回复
没看明白楼主要找什么东西……
纯净水o 2010-03-28
  • 打赏
  • 举报
回复
代码可能有些问题 完整代码如下
procedure TForm1.ConfigureButtonClick(Sender: TObject);
begin
ConfigureDialog.CheckBox1.Checked := image1.Visible;
ConfigureDialog.CheckBox2.Checked := image2.Visible;
if (image2.height=75) and (image2.width=75) then
ConfigureDialog.RadioGroup1.itemindex:=0
else
ConfigureDialog.RadioGroup1.ItemIndex:=1;
if (ConfigureDialog.ShowModal = mrOk) then
begin
Image1.Visible := ConfigureDialog.CheckBox1.Checked;
Image2.Visible := ConfigureDialog.CheckBox2.Checked;
if ConfigureDialog.RadioGroup1.ItemIndex=0 then
begin
image2.Left:=110;
image2.Top:=60;
image2.Height:=75;
image2.Width:=75;
end
else if ConfigureDialog.RadioGroup1.ItemIndex=1 then
begin
image2.Top:=15;
image2.Left:=70;
image2.Height:=150;
image2.Width:=150;
end;
end;
end;
纯净水o 2010-03-28
  • 打赏
  • 举报
回复
帮帮忙啊 小弟的求知欲很强啊

5,388

社区成员

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

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