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却没有分支了呢?

解决方案 »

  1.   

    代码可能有些问题 完整代码如下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;
      

  2.   

    procedure TForm1.form2ButtonClick这个事件在例子中位于activecontrol->onclick下
    ------------这是什么意思呢?