求救各位大神,can not focus a disabled or invisible window
delphi吧
全部回复
仅看楼主
level 1
是这样的,程序在主窗体上点击响应控件后打开子窗体,此时主窗体依然存在,然后在子窗体上点击控件,再在主窗体上响应该事件,于是就出现该错误信息。当然,在确定该错误信息后,我要响应的事件在主窗体上依然进行,只是不关闭子窗体,主窗体就不能响应鼠标。我在网上查过类似的错误信息,说是可以把要响应的窗体设为不自动创建,但是我这个是主窗体,不行。所以在此请教各位大神是否知道,急啊。谢谢!
2012年05月09日 15点05分 1
level 1
这是该函数:
procedure Tfolderdeepform.DBGridEh3DblClick(Sender: TObject);
begin
if (ADOQuery3.Active=True) and (ADOQuery3.RecordCount>0) then begin
MainForm.Visible := false;
MainForm.mnuFolderClick(nil);
MainForm.mnuFolder.Checked := true; //trick the toggle
with TFilesFrame(MainForm.FilesFrame) do begin if (pnlCaptionLeft.Color = ISMODIFIED_COLOR) then
begin
case application.MessageBox(pchar('Save changes to'#10 +
pnlCaptionLeft.Caption+' ? '),pchar(application.title),
MB_YESNOCANCEL or MB_ICONSTOP or MB_DEFBUTTON3) of
IDCANCEL: exit;
IDYES: SaveFileClick(MainForm.mnuSave1);
end;
end;
if (pnlCaptionRight.Color = ISMODIFIED_COLOR) then
begin
case application.MessageBox(pchar('Save changes to'#10 +
pnlCaptionRight.Caption+' ? '),pchar(application.title),
MB_YESNOCANCEL or MB_ICONSTOP or MB_DEFBUTTON3) of
IDCANCEL: exit;
IDYES: SaveFileClick(MainForm.mnuSave2);
end;
end;
DoOpenFile(ADOQuery3.FieldByName('sFilepath').AsString, true);
DoOpenFile(ADOQuery3.FieldByName('dFilepath').AsString, false);
Mainform.Show ;
end;
end;
end;
2012年05月10日 04点05分 3
level 1
额,是的。folderdeepform是子窗体。Mainform是主窗体
2012年05月10日 08点05分 5
level 1
哪位懂直接说怎么修改嘛,急啊
2012年05月13日 12点05分 7
level 11
主窗体 点击弹出 子窗体的代码
不能用 showmodal 要用 show
要不然.
你这里就改一下
Mainform.Show ;
改成 self.free
2012年05月14日 01点05分 8
主体窗在哪里 求救
2017年03月23日 02点03分
@H喜欢朴有天 不知道
2017年03月23日 10点03分
level 1
真心谢谢楼上,我在主窗体调用子窗体时将showmodal改成show就解决了,太谢谢啦!!!
2012年05月14日 01点05分 9
1