|
-
Jan 19th, 2008, 06:43 AM
#1
Thread Starter
Frenzied Member
Always On Top
Users can keep a VB app on top of the other apps/windows by clicking a menu. Clicking other menus & buttons residing on this app invoke other Forms. This is how I implemented the always on top feature:
Code:
Private Sub mnuAlwaysTop_Click()
If (mnuAlwaysTop.Checked = False) Then
mnuAlwaysTop.Checked = True
SetWindowPos Me.hWnd, HWND_TOPMOST, 0, 0, 0, 0, Flags
Else
mnuAlwaysTop.Checked = False
SetWindowPos Me.hWnd, HWND_NOTOPMOST, 0, 0, 0, 0, Flags
End If
End Sub
But when Forms belonging to this app are invoked, even they get hidden behing the main app.
How do I ensure that when the app is always on top, the Forms that get invoked by clicking menus & buttons belonging to this app (i.e. Forms that are part & parcel of this VB app) do not get hidden behind the main app though other open apps/windows stay behind this VB app?
ARPAN
IF YOU HAVE AN APPLE & I HAVE AN APPLE AND WE EXCHANGE THE APPLES, THEN YOU & I WILL STILL HAVE ONE APPLE BUT IF YOU HAVE AN IDEA & I HAVE AN IDEA AND WE EXCHANGE OUR IDEAS, THEN EACH OF US WILL HAVE TWO IDEAS!
NOTHING IS IMPOSSIBLE IN THIS WORLD.....EVEN THE WORD IMPOSSIBLE SAYS I'M POSSIBLE!
PRACTICE MAKES A MAN PERFECT BUT NOBODY IS PERFECT; SO WHY PRACTICE?
-
Jan 19th, 2008, 07:37 AM
#2
Re: Always On Top
If you have it set to always on top, then that is what it is going to be and all other forms will be behind it.
You would need to flip that off or perhaps minimize the window.
-
Jan 19th, 2008, 12:50 PM
#3
Re: Always On Top
Its doing exactly what you are telling it to do. You made the main form always on top and thats what its doing. If you want other forms to be always on top then when you click that menu to open on you will need to set that form as always on top.
VB/Office Guru™ (AKA: Gangsta Yoda™ ®)
I dont answer coding questions via PM. Please post a thread in the appropriate forum. 
Microsoft MVP 2006-2011
Office Development FAQ (C#, VB.NET, VB 6, VBA)
Senior Jedi Software Engineer MCP (VB 6 & .NET), BSEE, CET
If a post has helped you then Please Rate it! 
• Reps & Rating Posts • VS.NET on Vista • Multiple .NET Framework Versions • Office Primary Interop Assemblies • VB/Office Guru™ Word SpellChecker™.NET • VB/Office Guru™ Word SpellChecker™ VB6 • VB.NET Attributes Ex. • Outlook Global Address List • API Viewer utility • .NET API Viewer Utility •
System: Intel i7 6850K, Geforce GTX1060, Samsung M.2 1 TB & SATA 500 GB, 32 GBs DDR4 3300 Quad Channel RAM, 2 Viewsonic 24" LCDs, Windows 10, Office 2016, VS 2019, VB6 SP6 
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
|