windows – 如何在Delphi中隐藏MDI子窗体?
发布时间:2020-12-13 20:29:20 所属栏目:Windows 来源:网络整理
导读:如何在Delphi中隐藏MDIChild窗口? 我在我的MDI子项的FormClose()事件中使用此代码,但它似乎不起作用: procedure TfrmInstrument.FormClose(Sender: TObject; var Action: TCloseAction);begin Action := caNone; ShowWindow(Handle,SW_HIDE); frmMainForm.
如何在Delphi中隐藏MDIChild窗口?
我在我的MDI子项的FormClose()事件中使用此代码,但它似乎不起作用: procedure TfrmInstrument.FormClose(Sender: TObject; var Action: TCloseAction); begin Action := caNone; ShowWindow(Handle,SW_HIDE); frmMainForm.MDIChildClosed(Handle); end; 我的子窗口被最小化而不是被隐藏.
TCustomForm中有一个受保护的过程定义为:
procedure TCustomForm.VisibleChanging; begin if (FormStyle = fsMDIChild) and Visible and (Parent = nil) then raise EInvalidOperation.Create(SMDIChildNotVisible); end; 在您的MDI子窗口中覆盖它: procedure TMDIChildForm.VisibleChanging; begin // :-P end; Here’s a simple example 在阅读了Jeroen的评论后,我尝试了另一种解决方案,但也有一点点闪烁: procedure TMDIChildForm.VisibleChanging; begin if Visible then FormStyle := fsNormal else FormStyle := fsMDIChild; end; 也许这适用于所有Windows版本. PS:我没有发现Windows 2k3SP2 x86和Windows 7 Ultimate x86上的第一个解决方案有任何问题 (编辑:李大同) 【声明】本站内容均来自网络,其相关言论仅代表作者个人观点,不代表本站立场。若无意侵犯到您的权利,请及时与联系站长删除相关内容! |
相关内容
- Windows – 以静默方式在我的计算机上卸载并安装应用程序
- Windows应用商店应用 – XAML – C# – 在代码中访问ThemeR
- Emacs / GDB:始终使用gdb-many-windows在特定窗口中显示源
- windows-server-2008-r2 – 来自安全事件日志的XML查询过滤
- windows – 需要一种可以驱动两台打印机的快速编程语言
- 适用于Windows 7 64位操作系统的MYSQL安装程序?
- windows – DirectDraw分层窗口颜色键?
- windows-server-2008 – Windows Server 2008开始菜单,在右
- windows – 为什么tracert延迟不会增加ping延迟?
- Win32界面程序
推荐文章
站长推荐
- .net – Windows XP的Windows Identity框架
- [经验]windows10如果是台式机,别忘了在电源选项
- windows – powershell 2.0重定向文件处理异常
- 在多台Windows机器上自动执行基于Java的软件安装
- windows-server-2003 – 安装Google Apps Passwo
- windows – Chef:如何检查服务是否已安装?
- windows-server-2008 – Windows 2008:WinSXS目
- Clojure 1.9 windows安装
- 远程访问 – 将Team Viewer(8)设置为在后台运行(
- 我可以在Windows 7中将Django安装为脱机吗?
热点阅读