Answer the question
In order to leave comments, you need to log in
How to call a function that determines the focus for a Window?
Help please, I can not solve the issue with the Focus () function in the main Window.
The matter is that I have 2 Window (Windows). Window1 is the main form from which Window2 is launched. To set the focus of Window2, I can use code like this in Window1.
Window2 open = new Window2();
open.Focus();
Answer the question
In order to leave comments, you need to log in
You can pass a reference to an instance of Window1 to the Window2 constructor. For example, like this:
private readonly Window1 window1;
public Window2(Window1 window1)
{
InitializeComponent();
this.window1 = window1;
}
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question