Forum Discussion

howie_'s avatar
howie_
Contributor
10 years ago
Solved

Access to Winforms dialog titlebar buttons

Hi, 

 

I'm having difficulty programmatically identifying the red-x button at the top of a winforms dialog. I'm talking about the one in the top-right corner, normally seen next to the minimize and maximize buttons. Is anyone familiar with how to specify this button? I've been digging through the properties but I seem to be going around in circles.  

 

Any suggestions would be appreciated. 

 

Thanks, 

Howie 

3 Replies

  • brk9394's avatar
    brk9394
    Occasional Contributor

    In my Winforms apps, I cannot spy the 'X' button either. But I can spy the main Window, and then I can call the ".Close" method for that window.

    Brian

  • Add the class name of the main form to the MSAA entry in Current Project Properties\Open Applications\MSAA

    Save and it may take a few seconds to refresh.