Keep Form On Top??? (1 Viewer)

chris01252

Registered User.
Local time
Yesterday, 16:07
Joined
Feb 27, 2007
Messages
43
Not sure if this is possible. So any help would be welcomed.

What I want to do is have a small form sitting in the corner of my window that you can see all the time regardless of what I am doing in other windows (like the function in Winzip, to keep it on top). So I can just click on it straight away.

I only want this form to have a couple of buttons to open up other forms and I would like it to be as subtle as possible, so not sure if it can run outside of the main access window to reduce the amount of space it takes up.

Hope this makes sense.
 
Do you mean something more than just selecting "Popup" under the forms Other tab? If you select Popup = Yes and Modal = No you can click around your Db using other forms and the pop up remains on top.
 
I think what you want is a pop up form.
 
Thanks guys, that has solved part of it as I can place the form outside of the main access window.

But when I select another program window that I am working on i.e. Excel it disappears to the back. I want it to be visible all the time regarless of which program or window I am working on.
 
If you want to control that it's a Windows function not an Access function. I wouldn't know where to start.
 
I found this; it's a VB thing and not access though...

if you have an application and you want to keep it always on top of other windows.
this is an easy way to do it.

Usage:
To keep your form always on top call the
SetWindowOnTop Me, True
and to deactivate the always on top of other windows change the bAlwaysOnTop flag to false.
SetWindowOnTop Me, False

Declarations:
Private Const HWND_TOPMOST = -1
Private Const HWND_NOTOPMOST = -2
Private Const SWP_NOACTIVATE = &H10
Private Const SWP_SHOWWINDOW = &H40

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

Code:
Private Sub SetWindowOnTop(f As Form, bAlwaysOnTop As Boolean)
Dim iFlag As Long

iFlag = IIf(bAlwaysOnTop, HWND_TOPMOST, HWND_NOTOPMOST)

SetWindowPos f.hwnd, iFlag, f.Left / Screen.TwipsPerPixelX, f.Top / Screen.TwipsPerPixelY, _
f.Width / Screen.TwipsPerPixelX, f.Height / Screen.TwipsPerPixelY, SWP_NOACTIVATE Or SWP_SHOWWINDOW
End Sub
 

Users who are viewing this thread

Back
Top Bottom