是否有一个实用程序可以监视 .net winforms 中打开的 windows/ ?

发布于 2024-08-28 12:42:34 字数 204 浏览 7 评论 0原文

这是一个一般性问题,但我将解释我目前的具体需求:

我想找到一个框架类,使人们能够在设计时选择图像。我可以找到运行时使用的编辑器 - 它是 Drawing.Design.ImageEditor。然而,在设计时,会弹出一个不同的编辑器,允许人们从资源中选择图像。

我猜我可以运行某种程序,然后从属性网格打开图像编辑器,看看创建了哪些新窗口/类?

谢谢

This is a general question, but I'll explain my specific need at the moment:

I want to find the framework class that enables one to choose an image at design-time. I can find the editor that is used at run-time - its the Drawing.Design.ImageEditor. At design time, however, a different editor pops up which allows one to choose an image from resources.

I'm guessing I could run some kind of program, then open up the image editor, from the property grid, and see what new windows/classes have been created?

Thanks

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(2

昔日梦未散 2024-09-04 12:42:34

是的,您可以使用 Visual Studio 的另一个实例查看正在使用的内容,并使用“工具”+“附加到进程”(托管)来查看调用堆栈。它是一个 Microsoft.VisualStudio.Windows.Forms.ResourcePickerDialog。这不是您可以在自己的代码中使用的东西,Visual Studio 设计器程序集不可重新分发。它们也没有什么用处,它们会破坏项目的设计时状态。

拥有它并不难,只需使用 Reflection 迭代 Properties.Resources 的属性并找到具有 Bitmap 或 Icon 类型的属性即可。将它们显示在 ListView 中以允许用户选择一个。在运行时添加资源不是一个选项。

Yes, you can see what's being used by using another instance of Visual Studio and use Tools + Attach to Process (managed) to look at the call stack. It is a Microsoft.VisualStudio.Windows.Forms.ResourcePickerDialog. That is not something you can use in your own code, the Visual Studio designer assemblies are not re-distributable. Nor would they be useful, they monkey with the design-time state of the project.

Making you own isn't that hard, just use Reflection to iterate the properties of Properties.Resources and find the ones that have the Bitmap or Icon type. Display them in a ListView to allow the user to pick one. Adding resources at runtime isn't an option.

半世晨晓 2024-09-04 12:42:34

与您提到的功能类似的工具是 Spy++,您可以在开始菜单上的 Visual Studio 文件夹中找到它(在子菜单 Visual Studio Tools 下)。

但是,如果我理解正确的话,我不认为您所说的设计时编辑器是用托管代码编写的,即使是,我相当确定它不在框架中。它只是 Visual Studio 本身的一部分,据我所知您无法获取其源代码。

A tool with similar functionality to what you mention is Spy++ which you can find in your Visual Studio folder on the start menu (under the sub menu Visual Studio Tools).

However, if I understand you correctly, I don't think the design time editor you're talking about is written in managed code and even if it was, I'm fairly sure it's not in the framework. It's just part of Visual Studio itself and as far as I know you can't get hold of the source code for that.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文