标准对话框不弹出 [英] Standard dialog does not popup

查看:157
本文介绍了标准对话框不弹出的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有一个带有TSaveDialog的表单。当调用Execute功能时,它不会从IDE运行时弹出。在独立运行时,弹出窗口。稍微测试一下我发现所有的TSave / TOpen对话框都不起作用。不工作意味着执行返回 False 没有弹出窗口(请参阅更新的代码示例:始终显示消息False,而不在对话框之前)。 其他对话框(font / color / etc。) do

  procedure TForm1.Button1Click(Sender:TObject); 
begin
如果OpenPictureDialog1.Execute
then ShowMessage('True')
else ShowMessage('False');
结束

当运行不调试时,对话框都不出现。是否选择释放或调试配置也并不重要。



显然,IDE发生了一些奇怪的事情。表单上有两个TSaveDialog组件,两者都显示相同的行为。



任何想法有什么问题?



使用Windows上的Delphi XE更新1 7.使用TS​​aveDialogs的其他项目工作正常。



更新2 发现关于TSaveDialog的原始问题适用于所有TSave / TOpen对话框。问题已被编辑以包含这些知识。



更新3 我发现这个链接的类似错误。但是,我检查了注册表,但找不到所提到的可执行文件。并且将兼容性更改为XP的提示不适用于imho,因为TSaveDialog在IDE之外工作正常。

解决方案

如果您是使用XE2,那么您应该检查项目选项环境块的用户覆盖中没有任何条目。 包含系统变量不起作用,没有它,只有用户覆盖的环境变量在EXE启动的环境块中,但是打开/保存对话框需要一些系统变量,如SystemDrive和 SystemRoot。



或者,您可以安装修复包含的 IDE修订包系统变量选项。


I have a form with a TSaveDialog. When calling the Execute function it does not popup when running from the IDE. It does popup when running stand-alone. Testing it somewhat more I found that all TSave/TOpen dialogs don't work. Not working means that Execute returns False without a popup (see updated code example: always the message 'False' pops up without being preceded by the Dialog). The other dialogs (font/color/etc.) do work.

procedure TForm1.Button1Click(Sender: TObject);
begin
   if OpenPictureDialog1.Execute
      then ShowMessage ('True')
      else ShowMessage ('False');
end;

When run-without-debugging the dialog neither comes up. It also does not matter whether a Release or Debug configuration is selected.

Apparently the IDE does something weird. There are two TSaveDialog components on the form and both display the same behavior.

Any idea what is wrong?

Update 1 using Delphi XE on Windows 7. Other projects using TSaveDialogs work fine.

Update 2 Found out that the original question about TSaveDialog applied to all TSave/TOpen dialogs. Question has been edited to include this knowledge.

Update 3 I found this link of a similar error. However, I checked the registry but could not find an executable as mentioned. And the tip to change the compatibility to XP does not apply imho because the TSaveDialog works fine outside the IDE.

解决方案

If you are using XE2 then you should check that you do not have any entries in the "User overrides" of the Project Options Environment block. The "Include System Variables" isn't working and without it, only the user overridden environment variables are in the environment block with that the EXE is started, But the open/save dialog require some of the system variables like "SystemDrive" and "SystemRoot".

Alternatively you can install the IDE Fix Pack that fixes the "Include System Variables" option.

这篇关于标准对话框不弹出的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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