Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations bkrike on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Have a Top Level Form and a Form Inside the Top Level Form

Status
Not open for further replies.

bebbo

Programmer
Dec 5, 2000
621
GB
In Visual Foxpro you can State the form to be a TOp Level Form and show a child form inside that form. is there a way to do this with VB.

Basically I want to have my startup form and when a certain criteria is matched I want to show a seperate form which is exactly the same size and posituioned in the same area so the second form completely covers the first form.

Thanks
 
Look at MDI forms, or you can heve Form2 appear on top of Form1 using properties of Form1. Depends on what you want to do. You can also Hide forms and Show forms, in addition to unloading them when your finished with them. Up to you. Come back with a bit more and somebody is bound to come back with ideas.
 
HI, watch:

Thread222-674559
thread222-717708

you can use API for the top most...
Code:
    SetWindowPos Me.hWnd, HWND_TOPMOST, 0, 0, 0, 0, SWP_NOMOVE + SWP_NOSIZE

--
Luis MX
 
One example: You have two forms named Form1 and Form2 and you want Form2 to stay ontop of Form1, somewhere in your Form1 code...

Form2.Show , Form1

If you want the second form to cover the first form then why not hide the first form when the second one is loaded..

Form1.Hide

Hope you find some use for it!
 
oohhhhhh

try..

form1.hide
form2.show

or

form2.show
form2.left = form1.left
form2.top = form1.top

--
Luis MX
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top