Lossing focus...

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

Hi,
I have a login windows that appears after the main application starts, my
problem is that when the login window appears it loses the focus and became
deactivated...

I've tryied to put this.Activate on form_load, form_deactivate,
form_leave... and its no use...

What can I do to avoid this to happen...

is there a way to don't let the window deactivate and/or lose the focus?

Any help will be appreciated...
Kind regards
 
Diogo,

Why are you showing your login form after the main application starts?
Why not show your login window first, log in, and then load your application
if the login succeeded?
 
Thats what I am doing look at the code:

sp.Invoke(new MethodInvoker(sp.Close)); //Close Splash
Login formLogin = new Login();
formLogin.TopMost = true;
if (formLogin.DialogResult== DialogResult.OK) //Open Login, if login
succeded the run Application
Application.Run(new MainForm());


Nicholas Paldino said:
Diogo,

Why are you showing your login form after the main application starts?
Why not show your login window first, log in, and then load your application
if the login succeeded?


--
- Nicholas Paldino [.NET/C# MVP]
- (e-mail address removed)

"Diogo Alves - Software Developer"
Hi,
I have a login windows that appears after the main application starts, my
problem is that when the login window appears it loses the focus and
became
deactivated...

I've tryied to put this.Activate on form_load, form_deactivate,
form_leave... and its no use...

What can I do to avoid this to happen...

is there a way to don't let the window deactivate and/or lose the focus?

Any help will be appreciated...
Kind regards
 

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

Similar Threads


Back
Top