Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations bkrike on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

VB5- Form lost of focus

Status
Not open for further replies.

Rafa2002

Programmer
Dec 13, 2001
7
CA
Hello,
I have an strange lost of focus of the program when doing these steps:

1.-I have a main form and I load modal a new form as
show.form1 1, so form1 is now visible and fine.

2.- I load another program, like Eudora or Internet Explorar
3.- Using the Tab key I switch to my VB program, and close form 1 ( Using unload me and set form1=nothing)
4.- Instead of getting back to my may form,I always get the program I load before, Eudora or Internet Explorer....
Is there a way to return to my main form?
Thanks for any help
 
You might want to look at the SetWindowPos API call, which you can call from the form_unload event of form1, sending over the window handle of the main form as the first parameter. Good Luck
--------------
As a circle of light increases so does the circumference of darkness around it. - Albert Einstein
 
Thank you very much, this did the trick, and now an extra question...is there a way to know if the main form is on top or not?...I am just trying to see how this works.
Thanks again!
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top