Bringing Winform Window Forward

Asked

Viewed 1,866 times

1

There are some parts of my application that need feedback from the user, such as asking if you want to update, or on the system activation screen, but sometimes these screens, or messagebox, are left without selection, and stay behind the current window. I need to know how to leave a screen or messagebox on all the screens of the program, and maybe if possible, Windows whole, waiting for user response, so he have to answer rather than continue using the system or other program.

3 answers

3


Messagebox:

By default the MessageBox will always appear in front of all other windows.

Forms:

You can show the Forms with ShowDialog(), this will make it impossible for the user to interact with other Foms of the same application until the current form is closed.

The method BringToFront() can be used to place a form in front of the other application.

The method Activate() basically does the same thing as the BringToFront, with the added focus on the form.

As for putting the form in front of any operating system window, I think there is nothing native, anyway, I’ll look more about it.

Just a hint: users usually don’t like this type of behavior (pop-ups jumping in front of any window).

0

To leave your application in front of all the others in the terminal, or form in front of everything put this.TopMost = true, this way will always leave this application in front of ALL. Ai to work with the Forms use the methods already indicated: ShowDialog, BringToFront or Activate.

-1

For that you have to use the form you want on top as form.ShowDialog()

Browser other questions tagged

You are not signed in. Login or sign up in order to post.