give focus to the application at startup

  • Thread starter Thread starter Benoit Martin
  • Start date Start date
B

Benoit Martin

How can I make sure that my Windows application will have the focus at
startup?
Currently, if there is an Explorer window open when I launch my app for
example, the Explorer window will still have the focus after my app starts.
Even if no other app is running, my app will not be activated until the user
clicks on the window

Thanks
 
Benoit Martin said:
How can I make sure that my Windows application will have the focus at
startup?

Currently, if there is an Explorer window open when I launch my app for
example, the Explorer window will still have the focus after my app
starts.

Why do you say that?
Even if no other app is running, my app will not be activated until the user
clicks on the window

Why do you say that?
 
Benoit,
When a vb.net application start it has normaly the focus.
So you have to give more information to get a proper answer I think.
when you just do me.show or me.refresh, the focus is there (it is harder to
get it not there i think)
Cor
 
Sorry if my post was confusing... I was saying that to explain the
current behavior of my app. This is what I'm trying to fix

I understand that I need to provide more info as what I'm trying to
achieve should be normal behavior but I'm not too sure what else I can
add.

I start my application like this:
Application.Run(myMDIForm)

That's about all I did... There is nothing else fancy
 
Hi Benoir,

We can't work without information. Guessing is not always/often a
winning game.

Here's what you can do to help us help you:

Make a copy of your project in another folder. Make a zip of the
entire project. Put that somewhere safe. (This is a just-in-case
move.)

Now go into the copy of the project.

Remove as much as you can while still making sure that the strange
behaviour happens. So, if you have 6 forms, delete (not exclude) them
from the project one by one, making sure that you can still compile
and still run until the problems shows.

When you've done that remove as much code from the forms, modules
and classes that are left. Again making sure that you can still
compile and still run until the problems shows.

At this point you should have as much of a shell of the
application as possible.

Create a zip out of everything in the project folder. Do not
include the bin and Debug folders. You should end up with a smallish
zip file.

Post this to us.

We'll take it from there.

=================================

If this seems like too much work, then at least let us have the
source of your startup form.

Regards,
Fergus
 
Back
Top