0
I am with an application in wpf, with several buttons that open other windows outside the main system.
I call them through the:
.show(); Focus.();
If the user clicks multiple times the button opens multiple windows, I fixed this by placing a global variable that arrow when the window opens and closes.
The problem is that I need to focus on the window already open when the user clicks again on the button, because the window is already open, along with the main.
How about doing the disable button after this is clicked and have opened the new window successfully?
– ramaral
I can’t do that, my task is to focus on the open window, but I can’t.
– jp_almeida
How many windows of the same type can you have open? From what I understand each button opens a type of window, right?.
– ramaral
Yes each button opens a different window, what I need to do is bring in front of all the window that was requested on the button, understand?
– jp_almeida
I’m not sure I understand. Because, if each button opens only one type of window and there can be only one window of each type open, just, by clicking again on the button, do
janela.setFocus()
. If you post some code it would be easier to help!– ramaral
Usuario_Consultar frmGo = new Usuario_Consultar();

 if (util.Funcoes.is_open_window != 1)
 {
 util.Funcoes.is_open_window = 1;
 frmGo.Show();
 frmGo.Focus();
 }
– jp_almeida
This is the button pressing function, when it presses there is an instance of the window object that is declared. Then there is an if that asks if the global variable that controls the windows was set so there is no more than one window, entering if it opens the window and gives the focus to it.
– jp_almeida
Let’s go continue this discussion in chat.
– jp_almeida