3

How can I set IsOffScreen property for Microsoft UI Automation AutomationElement object?

I need to hide automation element.

I was able to find only TransformPattern and Resize method, but this pattern is not supported by my control (ListView).

Is this possible to acheive at all? I tried WPF Inspector and Snoop and both cannot change this text box visibility property. It's readonly.

update

Found Visibility property in WPF inspector and 'Snoop(IsVisibleis readonly, butVisibility` works), so they both can change element's visibility. Now I know it is possible.

Currently I'm trying to understand how it works. There are source codes available, but it is pretty much big application. Is there anything smaller or any samples available?

incognito
  • 457
  • 5
  • 19
  • You don't change the visibility of a control through UI Automation. To hide a control you set its `Visibility` to false (in WinForms) or Collapsed/Hidden (in WPF) in code. But sounds like you are trying to control the visibility of a control in another application, which you can't do. – Mike Zboray Apr 20 '14 at 20:44
  • 1
    I can easily do this for windows forms application with WinAPI SendMessage function, but it doesn't work with WPF for obvious reasons. So is there any other way? – incognito Apr 20 '14 at 21:12
  • You do realize that even if you *could* do that, it would break the layout? – Eric Brown May 15 '14 at 17:29
  • Yes, of course. This is not a problem. – incognito May 16 '14 at 12:48

0 Answers0