• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 303
  • Last Modified:

Floating Form in VB 6

How do I create a floating form in Visual Basic v6.0?
0
drago97
Asked:
drago97
  • 6
  • 3
  • 2
  • +2
1 Solution
 
Erick37Commented:
If you mean a form that is always on top, the answer is here:

"HOWTO: Create a Form That Always Stays on Top"

http://support.microsoft.com/support/kb/articles/q184/2/97.asp
0
 
drago97Author Commented:
I want to have 2 forms open and one smaller one floating that you can move around and is always on top.
0
 
sdland1Commented:
go to http://lightning.prohosting.com/~shell123/ search the sniplets section for Always On Top
0
The new generation of project management tools

With monday.com’s project management tool, you can see what everyone on your team is working in a single glance. Its intuitive dashboards are customizable, so you can create systems that work for you.

 
drago97Author Commented:
I was told to do the following:

Sub FloatingForm(frmParent as Form, frmFloater as form) frmFloater.show ,frmParent
End Sub

How exactly do I use this so it works?  what are the steps?
0
 
KDivadCommented:
Based on that, just substitute your normal Form2.Show line (assuming Form2 is the form you want floating) with this one: Form2.show, Form1 (assuming Form1 is the name of the form that Form2 is floating over).
0
 
sdland1Commented:
sdland1 changed the proposed answer to a comment
0
 
drago97Author Commented:
KDivad:
can you plz whip up a quick sample of this for VB6 to me at asian_arowana@hotmail.com and I'll give you 50 points for it. Thanks!
0
 
MaximkaCommented:
Just Put the code into You Form or Modul:


' SetWindowPos Flags
Private Const HWND_TOPMOST = -1

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 Sub MySetTopMost(ByVal liHwnd As Long)
   
10        Call SetWindowPos(liHwnd, HWND_TOPMOST, 0, 0, 0, 0, _
                            SWP_NOSIZE Or SWP_NOMOVE)
   
End Sub

And in Form_Load put the sentence

call MySetTopMost(me.hwnd)
0
 
KDivadCommented:
drago97,

It's on it's way to your mailbox.
For those who are reading, it's a project with two forms. Form1 is the startup and has a single line of code in it's Form_Load event: Form2.Show , Form1.

Later,
0
 
drago97Author Commented:
Adjusted points to 50
0
 
drago97Author Commented:
As a promised, 50 points for a working file...  thanks!!
0
 
drago97Author Commented:
opppsss!!  I think I gave the points to the wrong guy!!  How can I undo this?  Sorry KDivad!!
0
 
KDivadCommented:
No problem! ;-) It happens occasionally.

The last I heard, the points can't be taken back out of Maximka'a account.
If you want to, you can post a new question with a title that is something like "Points for KDivad" and the "question" being something like "For your help with http://www.experts-exchange.com/jsp/qShow.jsp?ta=visualbasic&qid=10272763 ". You can also use the "Community Support" link at the bottom of this page to see if they can return the points so that you can make the new question. I don't know if they will or not, but it's always worth checking on. If you don't want to post another question or go through the bother of contacting Support, then don't worry about it.

Later,
KDivad
0

Featured Post

Never miss a deadline with monday.com

The revolutionary project management tool is here!   Plan visually with a single glance and make sure your projects get done.

  • 6
  • 3
  • 2
  • +2
Tackle projects and never again get stuck behind a technical roadblock.
Join Now