폼2개 (Form1, Form2)가 있는데


Form1에서 항상 위 옵션을 체크를 하고


Button1을 눌러서 Form2를 모달상태로 열면 Form2 창이 뒤로 밀리는데 이거 어떻게 해결함????


체크박스를 해제하면 뒤로 밀리는거없는데, 항상 위 옵션을 켜면 저래...


implementation


uses Unit2;


{$R *.dfm}


procedure TForm1.Button1Click(Sender: TObject);

var

  sForm: TForm2;

begin

  sForm := TForm2.Create(Self);

  try

    sForm.ShowModal;

  finally

    FreeAndNil(sForm);

  end;

end;


procedure TForm1.CheckBox1Click(Sender: TObject);

begin

  if CheckBox1.Checked then begin

    SetWindowPos(Handle, HWND_TOPMOST, 0, 0, 0, 0, SWP_NOMOVE or SWP_NOSIZE);

  end else begin

    SetWindowPos(Handle, HWND_NOTOPMOST, 0, 0, 0, 0, SWP_NOMOVE or SWP_NOSIZE);

  end

end;