Show form on top of all the others

  • Thread starter Thread starter Teo
  • Start date Start date
T

Teo

Hi guys!
I am trying to display a login window that will ask the user to enter its
password before accessing the application.
I am wondering how I can do to display a form that will be on top of the
application and will stay locked until the user inputs the login, password
or aborts the use of the program by clicking the cancel button.
I have been trying to use the Topmost property but that doesn't seem to do
the trick.
Any suggestions?

Thanks much in advance,
Teo
 
Hi Teo,

Present your form with the ShowDialog method (rather than just Show) - the
form will then be presented modally and have exclusive focus in the
application.

-bwr-
 
Hi guys!
I am trying to display a login window that will ask the user to enter its
password before accessing the application.
I am wondering how I can do to display a form that will be on top of the
application and will stay locked until the user inputs the login, password
or aborts the use of the program by clicking the cancel button.
I have been trying to use the Topmost property but that doesn't seem to do
the trick.
Any suggestions?

Thanks much in advance,
Teo

Besides above solutions, you may let your application show the main
program form after login form has granted access. The first form
should be login-required form.
 
Back
Top