Is there a WinForm control inspector application?
I'm looking for something that provides interactive meta-data about a running .NET WinForms application.
Basically, I'd like to be 开发者_运维问答able to hover over a running WinForms application and have the inspector highlight the various controls and let me inspect properties such as size, position, parent, etc.
I could have sworn I've seen this somewhere, but all my searching is turning up nada.
I believe you're looking for Hawkeye. You may also look at GitHub for a more recent version.
WinForms Spy is a good one. The codeproject version doesn't have a draggable cross hairs but there is a version out there that added it.
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.
For a 2021 response the best is the Windows SDK Inspect.exe
https://developer.microsoft.com/en-us/windows/downloads/windows-10-sdk/
Run the inspect.exe from C:\Program Files (x86)\Windows Kits\10\bin<version>\x64 or x86
精彩评论