Reputation: 25
I have .NET desktop application. In my test I open application and click button to open DocWindow (WinWindow). After some actions I want to close DocWindow by [X] button. I tried to record this actions. Recorder generate code:
Mouse.Click(uITheRibbonPropertyPage, new Point(926, 15));
uITheRibbonPropertyPage is a control in the top of DocWindow. I think that click on coordinates is not very good idea. How to close WinWindow by some other way?
Upvotes: 0
Views: 1306
Reputation: 762
You can use Alt+F4 to close it.
Keyboard.SendKeys(yourDocWindowObject, "{F4}", ModifierKeys.Alt);
Upvotes: 1