Delphi和Designer代码 [英] Delphi and Designer Code

查看:67
本文介绍了Delphi和Designer代码的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

大家好

Delphi的新手,来自Visual Studio和.NET背景.

在.NET中,您可以在IDE中绘制组件并设置属性.然后,您可以查看Windows Designer生成的代码.

在Delphi IDE中,可以在IDE中绘制组件.有没有办法查看设置组件属性的代码?我正在研究第三方组件,并希望了解如何设置属性.

Hi All

New to Delp come from Visual Studio and .NET background.

In .NET, you can draw components in the IDE and set properties. You can then see the Windows Designer generated code.

In Delphi IDE, you can draw components in the IDE. Is there a way to see the code which sets the properties of the components? I am studying a third-party component and would like to see how the properties are set.

推荐答案

看到"是什么意思?如果您非常希望第三方组件带有源代码,那么您会看到所有内容,如果没有,则看不到任何源代码.使用.NET,您只能在C#或VB.NET中看到所有为System.Windows.Forms生成的代码. WPF有所不同:代码的一部分是XAML,而代码隐藏代码是在构建期间临时生成的,而不是源代码的一部分.很好,您仍然可以看到它,只是学习它是如何工作的.在现实生活中,开发人员不会看这些代码.当代码提交到版本控制系统等时,它将与其他临时文件一起删除.

在Delphi中不是这样. Delphi更像WPF:源代码由Pascal代码和* .DFM文件组成,可以是文本或二进制文件.这些文件是项目的一部分,源文件.

您需要先了解编程文件系统,然后学习哪些文件是源代码的一部分,哪些不是源文件的一部分,并且确切地知道每种文件类型的用途. Deplhi的特定方式是在Pascal文件中包含更多内容,例如,应用程序项目文件* .DPR是Pascal文件.

供参考,请看以下内容:
http://delphi.wikia.com/wiki/Delphi_File_Extensions [
What do you mean "see"? If you got your third-party component with source code, which is highly desirable, you see everything, if not — you don''t see any source code. With .NET, you see all generated code in C# or VB.NET only for System.Windows.Forms. WPF is different: part of the code is XAML, and the code-behind code is generated during build on temporary basis and is not a part of the source code. It''s good, you still can see it, just to learn how it works. In real life, a developer don''t look at this code; it is deleted with other temporary files when code is submitted to revision control system and the like.

Not quite so in Delphi. Delphi is more like WPF: source code consists of Pascal code and *.DFM files, which can be text or binary. These files are part of the project, source files.

You need to start your acquaintance with programming system with learning what files are part of your source code and what are not and know exactly the purpose of each file type. The Deplhi-specific way is having more in Pascal files, for example, application project files *.DPR are Pascal files.

For reference, look at this:
http://delphi.wikia.com/wiki/Delphi_File_Extensions[^].

Is there anything you''re not sure about? If not, you are in trouble: you investment in code base is too valuable and is at risk. Stop doing anything else and learn it.

—SA


在设计时,右键单击表单,然后选择查看代码 :)

您将看到层次结构样式的属性

然后再次右键单击并选择查看表单以再次查看表单
In design time right click on a form and select view code :)

you will see properties in a hierarchy style

and right click again and select view form to see the form again


这篇关于Delphi和Designer代码的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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