You must Sign In to post a response.
  • Category: WPF

    Close current window and open new window in WPF

    i have main window now i want to open new window but i want to close current window

    close current window and open new window in WPF
  • #756722
    Hai Ashok,
    In WPF WinForms application, first you need to create the Second window object and then assign it to the parent(Owner) and then close the first window.
    You can try with the below code snippet:

    protected void OpenWindow(object sender, RoutedEventArgs e)
    Form2 form2Obj = new Form2();
    form2Obj.Owner = this;

    Hope it will be helpful to you.

    Pawan Awasthi(DNS MVM)
    +91 8123489140 (whatsApp), +60 14365 1476(Malaysia)

  • Sign In to post your comments