Always On Top??

Milo
11-15-2004, 04:29 AM
I am using VB6. In my project I have a main form that calls a map form from a menu button. When the map form shows it appears on top of all other forms as you would expect...however, it seems to have the "always on top" functionality! In the form_load of the map form I have this:

Private Sub Form_Load()
mapTrack.NewMap geoMapEurope
bLiveTrack = False
gbMapShow = True
End Sub

However, when I do this (comment out the newmap line):

Private Sub Form_Load()
'mapTrack.NewMap geoMapEurope
bLiveTrack = False
gbMapShow = True
End Sub

The project seems ok (no "on top").

Anyone any ideas?

Regards,
Milo

Milo
11-15-2004, 05:30 AM
I have solved this by putting
SetWindowPos Me.hwnd, HWND_NOTTOPMOST, 0, 0, 0, 0, _
SWP_NOACTIVATE Or SWP_SHOWWINDOW Or SWP_NOMOVE Or SWP_NOSIZE

at the end of form_load. I have done a search for SetWindowPos throughout my whole project and there is nothing that sets the map form to the front?!!? I would still be interested to see if anyone has any comments on this though.

Regards,
Milo

 
Web mp2kmag.com
mapforums.com