菜题!!!关闭一个正在create的窗口? 怪!叏!夬!希望高手进来看看!! 怎么没有给帖子加分的功能?? (20分)

  • 主题发起人 shadowno
  • 开始时间
你如下代码
Form2.OnShow()
begin
if Form1.checkbox1.checked then
Close;
end;
 
不好意思,上面的代码没有用,我试了一下,不行。
重写如下代码:
procedure TForm2.FormPaint(Sender: TObject);
begin
if Form1.checkbox1.checked then
Form2.Close;
end;

已经试过了,可行,不过不知道对不对你的思路
 
postquitmessage(0)你试验一下把
 
form2.Close;换成 postmessage(handle,wm_close, 0, 0) ;
 
顶部