简体   繁体   English

Snoop没有看到我的应用程序的子窗口

[英]Snoop doesn't see my application's child windows

When I run Snoop 2.8, it sees my program's main window and lists it in its ComboBox . 当我运行Snoop 2.8时,它会看到我的程序的主窗口并在其ComboBox列出它。 However, my program creates a child window that is displayed by calling ChildWindow.Show() . 但是,我的程序创建了一个通过调用ChildWindow.Show()显示的子窗口。 No matter what I do, I can't snoop that child window. 无论我做什么,我都无法窥探那个孩子的窗户。 If I refresh the list of windows, it doesn't show up. 如果我刷新窗口列表,它不会显示。 If I drag the little cross hairs icon next to the binoculars over the child window, the main window comes up. 如果我将双筒望远镜旁边的小十字线图标拖到子窗口上,则会出现主窗口。

How do I Snoop my applicaton's child window? 如何窥探应用程序的子窗口?

When I use Snoop, I always first start snoop and then use the "shift+control" shortcut to focus on what I want. 当我使用Snoop时,我总是首先开始窥探然后使用“shift + control”快捷键来专注于我想要的东西。 This seems to work even if I do it to a child window. 即使我对子窗口这样做,这似乎也有效。 So try this: 试试这个:

  1. Start application, open child window 启动应用程序,打开子窗口
  2. Run Snoop 运行Snoop
  3. Snoop any window in the application 窥探应用程序中的任何窗口
  4. Focus on your child window (click on the title bar of the window) 专注于您的子窗口(单击窗口的标题栏)
  5. Move the mouse over what you want to inspect, and hold down the Shift and Control keys simultaneously 将鼠标移动到要检查的内容上,同时按住Shift和Control键
  6. A red outline appears in your application, and you should see Snoop show/select the element in question in the tree. 您的应用程序中会出现一个红色轮廓,您应该看到Snoop在树中显示/选择有问题的元素。 If you look up the visual tree on the left you will now see the child window is the parent of the tree. 如果查看左侧的可视树,您现在将看到子窗口是树的父窗口。

This solution was last tested in Snoop 2.8. 该解决方案最后在Snoop 2.8中进行了测试。

Have you ever look for WPF Inspector? 你有没有找过WPF检查员? I always use it instead of snoop and and never had any problem with child windows... 我总是使用它而不是窥探,并且从未对儿童窗户有任何问题......

http://wpfinspector.codeplex.com/ http://wpfinspector.codeplex.com/

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM