Click here to Skip to main content
15,898,937 members
Please Sign up or sign in to vote.
4.00/5 (1 vote)
See more:
How do keep track of window resizing and max/min using UI Automation in visual Studio.
Posted

1 solution

Hi,

Just register to the StateChanged event:

C#
/// <summary>
/// Interaction logic for MainWindow.xaml
/// </summary>
public partial class MainWindow : Window
{
    public MainWindow()
    {
        InitializeComponent();

        this.StateChanged += new EventHandler(MainWindow_StateChanged);
    }

    void MainWindow_StateChanged(object sender, EventArgs e)
    {
        MessageBox.Show(this.WindowState.ToString());
    }
}
 
Share this answer
 
Comments
Dhanush Shetty 13-May-14 2:28am    
what if it is for a different window/application?

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900