简体   繁体   English

如何在Delphi IDE启动时停止打开表单

[英]How can I stop forms from opening on Delphi IDE startup

For my first question ever on Stack Overflow I have to ask you about this issue I'm having with Delphi 2007. 对于Stack Overflow上的第一个问题,我不得不问你关于Delphi 2007的这个问题。

At the startup of my project, the IDE always open a set of forms from my project. 在我的项目启动时,IDE总是从我的项目中打开一组表单。

For example, let's take a project where I have 50 forms. 例如,让我们进行一个项目,其中有50个表单。 Every time I open the project, the IDE will open some of these forms (they are always the same one). 每次打开项目时,IDE都会打开其中一些表单(它们总是相同的)。 My question being : Is there a list somewhere in the options where you can put a list of form to automatically open in Delphi on startup? 我的问题是:在选项中是否有一个列表,您可以在启动时将表单列表自动在Delphi中打开? I've been looking on 5 different forum about this and I've never found anything. 我一直在寻找关于这个的5个不同的论坛,我从来没有找到任何东西。 Is this some sort of configuration? 这是某种配置吗?

Go to Tools->Options from the main menu. 从主菜单转到工具 - >选项

Check the Autosave options->Project desktop item, and click OK to apply the change. 选中自动保存选项 - >项目桌面项,然后单击确定以应用更改。 Close the dialog. 关闭对话框。

Go back to your project. 回到你的项目。 Close all the files you don't want to open any more when the project is first loaded, then use File->Save All from the main menu. 首次加载项目时,请关闭所有不想再打开的文件,然后使用主菜单中的文件 - >全部保存 (The quickest way to close the file is to right-click the editor tab at the top and choose Close Page from the context menu.) (关闭文件的最快方法是右键单击顶部的编辑器选项卡,然后从上下文菜单中选择“ 关闭页面 ”。)

The IDE will remember the forms you have open when you save the project, and will reopen them the next time the project is loaded. IDE将记住您在保存项目时打开的表单,并在下次加载项目时重新打开它们。 To make sure they're only the ones you want, close all of the forms you don't want to be open before exiting. 要确保它们只是您想要的那些,请在退出之前关闭所有不想打开的表单。

You can remove forms that are being auto-opened by simply making sure they're closed when you next save the project. 您可以通过简单地确保在下次保存项目时关闭它们来删除自动打开的表单。 (And conversely, you can add forms that you want to be auto-opened by just making sure they're open when the project is saved.) (相反,您可以添加要自动打开的表单,只需确保在项目保存时打开它们。)

It IS possible to have it open only the forms you want the same every time regardless of how you left the project on the last save! 无论您在上次保存时如何离开项目,都可以让它每次只打开您想要的表单!

1) Go to Tools-Options from the IDE's menu. 1)从IDE菜单转到Tools-Options。

2) In the Environment Options tick the option 'Project Desktop', and click OK. 2)在Environment Options中选中'Project Desktop'选项,然后单击OK。

3) Go back to your project. 3)回到你的项目。 Close all forms, and only open up the forms that you want to show when the project is opened. 关闭所有表单,仅打开项目打开时要显示的表单。

4) Save the project. 4)保存项目。

5) Close out of Delphi, and Re-open Delphi 5)关闭Delphi,重新打开Delphi

6) Go back into Tools-Options and UNTICK the option 'Project Desktop'. 6)返回Tools-Options并选择'Project Desktop'选项。

Now you should be able to open up your project and have only the forms you want open show. 现在,您应该能够打开项目并只显示要打开的表单。 Even if you open up more forms and then save and close - it should only open up the forms in step (3) as any changes made afterwards won't be changed again as we've unticked the option in step 6! 即使您打开更多表单然后保存并关闭 - 它应该只打开步骤(3)中的表单,因为之后所做的任何更改都不会再次更改,因为我们已经取消了步骤6中的选项!

If you leave Project Desktop ticked you run into the problem of it remembering whatever forms were left open from the last time the project was opened - so the trick is to only have this ticked whilst setting up your preferred 'layout', and then untick it afterwards. 如果您勾选Project Desktop,则会遇到问题,即记住上次打开项目时打开的任何表格 - 所以诀窍是在设置首选'布局'时只勾选这个,然后解开它然后。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM