 |

03-25-2003, 10:09 AM
|
|
Centurion
|
|
Join Date: Jan 2003
Posts: 185
|
|
Always on top
|

03-25-2003, 10:15 AM
|
 |
Senior Contributor
* Expert *
|
|
Join Date: Sep 2002
Location: Karlsruhe, Germany
Posts: 1,319
|
|
Add this code to a module
Code:
Private 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
Public Const HWND_TOPMOST = -1
Public Const HWND_NOTOPMOST = -2
Public Sub SetTop(OnOff As Boolean)
If OnOff Then
Call SetWindowPos(Me.hwnd, HWND_TOPMOST, 0, 0, 0, 0, 3)
Else
Call SetWindowPos(Me.hwnd, HWND_NOTOPMOST, 0, 0, 0, 0, 3)
End If
Make a call like this to set always on top
|
Last edited by Robse; 03-25-2003 at 10:20 AM.
|

03-25-2003, 10:21 AM
|
 |
Mexican Coder
|
|
Join Date: Jun 2002
Location: Monterrey, N.L., Mexico
Posts: 2,793
|
|
|
I think this code can't be added to a module because Me.Hwnd will not works !!!
May be need to add the function in the form code
|
__________________
Mikecrosoft.NET
* If I stop to ask I will stop to learn
* Just I know that I don't know nothing
|

03-25-2003, 10:26 AM
|
 |
Senior Contributor
* Expert *
|
|
Join Date: Sep 2002
Location: Karlsruhe, Germany
Posts: 1,319
|
|
Quote: Originally Posted by Mikecrosoft I think this code can't be added to a module because Me.Hwnd will not works !!!
May be need to add the function in the form code
Mikecrosoft is right.
So forget the above code and just call The Function
from wherever you want to like this
Code:
Call SetWindowPos(Me.hwnd, HWND_TOPMOST, 0, 0, 0, 0, 3)
to set the window on top.
|
|

03-25-2003, 10:54 AM
|
|
Centurion
|
|
Join Date: Jan 2003
Posts: 185
|
|
|
|
Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
|
|
|
| Thread Tools |
|
|
| Display Modes |
Linear Mode
|
Posting Rules
|
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts
HTML code is Off
|
|
|
|
|
|