Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 6717727
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 26, 20262026-05-26T08:53:10+00:00 2026-05-26T08:53:10+00:00

I have two WPF windows. One is the main window and the other is

  • 0

I have two WPF windows. One is the main window and the other is some configuration window.
I would like the configuration window to send and event to the main window.
Any idea how I an accomplish it?

This is how I create and open the configuration window :

 private void MenuItem_Click(object sender, RoutedEventArgs e)
    {
        ConfigPage Confwin= new ConfigPage();
        Confwin.Owner = this;
        Confwin.Show();
    }
  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-26T08:53:11+00:00Added an answer on May 26, 2026 at 8:53 am

    You can define any event in your child window class and subscribe to it before showing the window.

    Main Window

    public partial class MainWindow : Window
    {
        public MainWindow()
        {
            InitializeComponent();
    
            this.Loaded += new RoutedEventHandler(MainWindow_Loaded);
        }
    
        void MainWindow_Loaded(object sender, RoutedEventArgs e)
        {
            Child childWindow = new Child();
            childWindow.MyEvent += new EventHandler(childWindow_MyEvent);
    
            childWindow.ShowDialog();
        }
    
        void childWindow_MyEvent(object sender, EventArgs e)
        {
            // handle event
            MessageBox.Show("Handle");
        }
    }
    

    Child window

    public partial class Child : Window
    {
        // define event
        public event EventHandler MyEvent;
    
        protected void OnMyEvent()
        {
            if (this.MyEvent != null)
                this.MyEvent(this, EventArgs.Empty);
        }
    
        public Child()
        {
            InitializeComponent();
    
            this.Loaded += new RoutedEventHandler(Child_Loaded);
        }
    
        void Child_Loaded(object sender, RoutedEventArgs e)
        {
            // call event
            this.OnMyEvent();
        }
    }
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

This one has me beat; I have a WPF window with two (important for
I have Two WPF window Window1.xaml and window2.xaml. In window2.xaml.cs i have one function
I have a window (Windows form ) where i have two WPF user controls
I have multiple windows in a wpf project. in any window, i put a
I have a main thread that contains my WPF GUI and one or more
I have simple Windows Forms application (not WPF), and I have two controls on
I have two collections displayed in my WPF application, and I'd like to have
There are two namespaces with class Image. One is iTextSharp and another WPF System.Windows.Control.Image
Let say I have are two WPF forms: Form1 and Form2 . Form1 contains
I have two different ways of displaying items in a WPF application. The first

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.