473,480 Members | 1,874 Online
Bytes | Software Development & Data Engineering Community
Create Post

Home Posts Topics Members FAQ

New Form In Same Position of Closed Form

9 New Member
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!
Feb 22 '08 #1
11 1607
debasisdas
8,127 Recognized Expert Expert
Have you worked on TOP and Left property of the form ?
Feb 22 '08 #2
creative1
274 Contributor
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 luck
Feb 22 '08 #3
QVeen72
1,445 Recognized Expert Top Contributor
Hi,

If both of your Forms are of same size, then
Simply set this property in Property Sheet of both the forms:
StartUpPosition =2 - CenterScreen

Automatically, both will be Popped up in the Same Position..

REgards
Veena
Feb 22 '08 #4
gumdealer328
9 New Member
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?
Feb 22 '08 #5
MarkTingson
40 New Member
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?
try this:
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 UnloadAll
Feb 23 '08 #6
lotus18
866 Contributor
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?
It is something like the first form is in active. If you want to terminte your application by clicking the close button of the 2nd form, you can simply add

Expand|Select|Wrap|Line Numbers
  1. Private Sub Form_Unload(Cancel As Integer)
  2.      End
  3. End Sub
  4.  
Rey Sean
Feb 23 '08 #7
gumdealer328
9 New Member
where do i add this code?
Feb 24 '08 #8
lotus18
866 Contributor
Just add 'End' at the Unload Event of the 2nd form ; )
Feb 24 '08 #9
gumdealer328
9 New Member
there isn't an unload event for the 2nd form :(
Feb 24 '08 #10
lotus18
866 Contributor
there isn't an unload event for the 2nd form :(
Really? .
Feb 25 '08 #11
Killer42
8,435 Recognized Expert Expert
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.
Feb 25 '08 #12

Sign in to post your reply or Sign up for a free account.

Similar topics

0
1424
by: cabrenner | last post by:
First of all, I have been using the newsgroup to find answers to my development questions for several months, and it has been extremely helpful. I have an access app which closes all toolbars...
6
2417
by: dale zhang | last post by:
Hi, I build a web form with a 4-cell table on the top (flawlayout), followed by some labels and textboxes (gridlayout). The web form is displayed well in dell m60 laptop with all resolution...
6
7223
by: Rob | last post by:
This is a curious problem. It seems like it should be quite easy. Of course a timer is used to determine when form should be closed, but how do you consistently reset the timer when the mouse is...
7
1141
by: Marc | last post by:
Hi, I am using the below code to add a button to form. However it is not working. If I change the form name from 'form1' to 'me' it does add the button to the current form...any ideas. Also...
3
55906
by: Andrew Hall | last post by:
Hi all Can anyone advise how to get the position of an open form and how to set the position of an opening form within the access window. I have: MA Access97 (because I do not have the funds...
11
5256
by: Zytan | last post by:
I have created a new form from the main form. When I close the main form with the 'x' close button, its Form.FormClosed event is run, but not the dialog's. Is this normal? It is ok /...
40
2612
by: Jukka K. Korpela | last post by:
My basic style sheet has a distinctive background and border for forms, to make the structure clearer and to make it visually evident what belongs to a form. However, as people complained that...
6
2247
by: Thom Little | last post by:
Using C# 3.5 I have a form that calls many other sub-forms. Typically there will be five forms open at the same time. If the main form is closed all the sub forms are also closed. Is there...
10
2173
by: Kelly | last post by:
Can anyone tell me what I'm doing wrong here? ================================== <html> <head> <title>Test Form</title> <script language="JavaScript" type="text/javascript"> </head>
0
6908
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
7043
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
7081
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
1
6737
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
5336
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
0
2995
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The...
0
2984
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
563
muto222
php
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
0
179
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.