I make a second form pop-up and hide the original form by pressing my Next button. How do I make the next form(s) that pop-up appear in the same coordinates as the original? This will make it look like the form is just reloaded in the same spot with new info on it. Any help is greatly appreciated! Thanks in advance!
New Form In Same Position of Closed Form
Collapse
X
-
Tags: None
-
-
Its very easy to do that.
First of all note the height; width properties of your first form; and set top and left properties of that form to make it appear whereever you like.
Now take control of you rsecond form and set all properties (width, height,top,left ) same as they were for first form. It will do the desired job.
good luckComment
-
thanks! i got it to work! now the only other problem is why doesn't the application exit when I click the "X" in the upper right corner of the second form?Comment
-
Originally posted by gumdealer328thanks! i got it to work! now the only other problem is why doesn't the application exit when I click the "X" in the upper right corner of the second form?
Public Sub UnloadAll()
Dim oFrm As Form
For Each oFrm In Forms
Unload oFrm
Next
Set oFrm = nothing
End Sub
put this line of code in your queryunload of Form1:
Call UnloadAllComment
-
Originally posted by gumdealer328thanks! i got it to work! now the only other problem is why doesn't the application exit when I click the "X" in the upper right corner of the second form?
[CODE=vb]Private Sub Form_Unload(Can cel As Integer)
End
End Sub
[/CODE]
Rey SeanComment
-
-
-
If you mean the Unload event isn't triggered, then presumably you aren't unloading it, which is the whole problem. When your application won't go away, it usually means you have left one or more forms loaded. This is lazy programming, and the sort of thing which wastes resources.
You should ensure all forms are unloaded (not just hidden) when you're finished with them. And remember that referring to any of their properties will probably cause them to be loaded again, even if you don't show them.Comment
Comment