Delphi TColorDialog打开了一个stayOnTop表单 [英] Delphi TColorDialog Opens behind a stayOnTop form

查看:233
本文介绍了Delphi TColorDialog打开了一个stayOnTop表单的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有一个主窗体(form1),它调用form2,这是一个停留窗体。 form2调用一个模式形式(form3),它也是一个停留窗体。当form3模态窗体调用colordialog时,颜色对话框将在form3后面打开。



在form3前面设置打开颜色对话框?



我正在使用D2009



谢谢

解决方案

Delphi(D2007周围)介绍了一个重载的执行接受父窗口句柄作为参数的所有标准对话框的方法。更改您的呼叫以显示对话框:

 如果ColorDialog1.Execute(Handle)然后
begin
/ /做任何
结束;

句柄在这种情况下将是窗口在顶部表单上显示 TColorDialog 的句柄。如果您正在从另一个窗口执行该对话框,则需要在顶部表单的句柄上传递保留。



文档是 here (XE版本,但仍适用于D2009)。


I have a main form (form1) that calls form2 which is a stayontop form. form2 calls a modal form (form3) which is also a stayontop form. when form3 modal form calls the colordialog, the color dialog opens behind form3.

What to set to open color dialog in front of form3?

I'm using D2009

thanks

解决方案

Delphi (around D2007) introduced an overloaded Execute methods for all of the standard dialogs that accept a parent window handle as a parameter. Change your call to display the dialog:

if ColorDialog1.Execute(Handle) then
begin
  // Do whatever
end;

Handle in this case would be the window handle of the stay on top form that's displaying the TColorDialog. If you're executing the dialog from another window, you'll need to pass the stay on top form's handle instead.

The documentation is here (XE version, but it still applies to D2009).

这篇关于Delphi TColorDialog打开了一个stayOnTop表单的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆