I'm working with a winforms application that is targeting .net 4.5 and I really need to inspect the UI elements. I've used Snoop to inspect wpf elements in the past, and I've come across Hawekeye as well. However, it appears hawkeye is not compatible with .net 4.5. Are there any tools out there than can give me similar results?

有帮助吗?

解决方案 4

Seems like the old tools no longer work like UI Spy either. Microsoft have an Inspect tool available here (Inspect tool). It's part of the Win8 SDK.

I'm looking at the same problem myself today, so will be trying it shortly.

其他提示

There is Hawkeye 2 (https://github.com/odalet/Hawkeye2). It works for me with .NET Framework 4.5.

There is Spy++.exe within Microsoft Visual Studio, very useful and works like that.

Try the nuget package: WinForm.Inspector.Tool

Setup documentation

  • Instantiate the Inspector in your project.

    Inspector inspector = new Inspector();

  • Ignore specific controls ex. buttons.

    inspector.IgnoreTypes = new Type[] { typeof(Button) };

  • Skip controls ex. invisible and disabled.

    inspector.SkipChilds = GetChildAtPointSkip.Invisible | GetChildAtPointSkip.Disabled;

Run your project and press Ctrl + F8 to open the ControlViewer.

Hold down Alt and move your mouse over the controllers to select them.

enter image description here

许可以下: CC-BY-SA归因
不隶属于 StackOverflow
scroll top