creating logon box in c# .NET

E

eddy k

I am creating a windows application. Before entering the main form I
want to have a logon box. I create this box from the constructor of the
main form, but when the logon box opens it is not in focus. How can I
force a form to be in focus?
 
M

Morten Wennevik

Hi,

If you use ShowDialog to show the form, then it will be displayed in front
of the parent form. As an alternativ to create the logon box from the
main form, you could display it in the Main method before launching the
main form. That way the main form will never even be displayed if the
logon failed.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top