是否有任何实用程序可以列出 WinForm 的所有组件?
我们之前的开发人员使用插件 (Infragistics) 来创建 UI 组件(按钮、选项卡、底座、标签等),但它需要包含所有 DLL。
我希望将其转换为带有“库存”UI 组件的基本 WinForm,而不使用 Infragistics(较小的安装?几乎没有 DLL)。
我想知道是否有一个工具/插件可以列出给定 WinForm 中所有组件/元素的 Name 属性(可能更多)?
C#MVS2008
Our previous developer used a plugin (Infragistics) in order to create the UI components (buttons, tabs, docks, labels, etc.) but it requires all of it's DLLs to be included.
I'm looking to convert this to a basic WinForm with "stock" UI components without using the Infragistics (smaller install? almost no DLLs).
I was wondering if there is a tool/plugin that will list the Name property (possibly more) of all the components/elements in a given WinForm?
C# MVS2008
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(3)
它内置于 Visual Studio 中。查看+(其他窗口)+文档大纲。在设计模式下打开表单。它显示了表单中所有控件和组件的列表,以及名称和类型。
It is built into Visual Studio. View + (Other Windows) + Document Outline. Open the form in design mode. It shows a list of all the controls and components you have in the form with Name and Type.
最有可能的是,之前的开发人员使用 Infragistics 是有原因的。这些控件库提供比默认 WinForms 控件更多的功能。如果他使用了那个高级功能,你就不能简单地替换它们,因为WinForms控件中没有相应的功能。包含 DLL 并不是真正的问题,如果是,只需使用 ilmerge 将它们合并到您的 EXE 中...这将减少您需要部署的文件数量。
Most likely, there was a reason, why the previous developer used Infragistics. Those control libraries offer more functionality than the default WinForms controls. If he used that advanced functionality, you can't simply replace them, because there is no corresponding functionality in the WinForms control. Including the DLLs isn't really a problem, and if it is, just merge them into your EXE using ilmerge... This will reduce the number of files you need to deploy.
好吧,你可以很容易地自己创建这样一个工具,下面是一个 C# 示例,说明如何获取 WinForm 的所有控件的列表:
当然,你必须调用
var lst = FindAllControls(theForm )
进入程序的某个位置并处理结果。Well, you can create such a tool very easily on your own, here is a C# example of how to get a list of all controls of a WinForm:
Of course, you have to place a call
var lst = FindAllControls(theForm)
somewhere into your program and process the results.