|
-
Aug 27th, 2000, 05:32 AM
#1
Thread Starter
Member
How do I make my app AlwaysOnTop?
Its easy to do it in Delphi but in VB I can't find anything to do this.
Thanx in advance for any reply.
Celery
VB6 Pro SP3 - Academic Licence
-
Aug 27th, 2000, 05:39 AM
#2
New Member
Not hard, this one:
Add the following to a module:
Code:
Declare Function SetWindowPos Lib "user32" (ByVal hwnd As Long, ByVal hWndInsertAfter As Long, ByVal x As Long, ByVal y As Long, ByVal cx As Long, ByVal cy As Long, ByVal wFlags As Long) As Long
Global Const SWP_NOMOVE = 2
Global Const SWP_NOSIZE = 1
Global Const FLAGS = SWP_NOMOVE Or SWP_NOSIZE
Global Const HWND_TOPMOST = -1
Global Const HWND_NOTOPMOST = -2
Then add this to the Form_Load of the form you want on top (make sure you replace FORM1 with the form's name):
Code:
res& = SetWindowPos(FORM1.hwnd, HWND_TOPMOST, _
0, 0, 0, 0, FLAGS)
Failing that, there are a few good AOT controls around.
Hope this helps...
from Starsky
VB6 Pro SP3
I'm not stupid, I just don't post a lot. No, really... 
-
Aug 27th, 2000, 05:49 AM
#3
Thread Starter
Member
Thanx for your reply Starsky!
But Delphi still has much easier way to do that - you just
set FormStyle to StayOnTop. I can't understand why VB can't
copy some things from Delphi (and vice versa). Programming
would be much easier for everyone!
Celery
VB6 Pro SP3 - Academic Licence
-
Aug 27th, 2000, 07:26 AM
#4
Frenzied Member
are you serious? Delphi had the OnTop feature?
NXSupport - Your one-stop source for computer help
-
Aug 27th, 2000, 07:38 AM
#5
Thread Starter
Member
Yeah!
I had Delphi 3 and it was very easy to switch from AlwaysOnTop to Normal form style in
design- and runtime.
I really miss that in VB!
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|