Which form ?

  • Thread starter Thread starter Stan Sainte-Rose
  • Start date Start date
S

Stan Sainte-Rose

Hi,
How to know which form has called the current form ?

Btw, when I load a form, how to close the current form that call the new
form ?

Stan
 
Stan Sainte-Rose said:
Hi,
How to know which form has called the current form ?

Usually it is not necessary to know that. If you need it: Pass the calling
Form to the called Form.
Btw, when I load a form, how to close the current form that call the
new form ?

1. show the new form
2. close the current form

If the closed form is the startup object of the project, you have to add
your own sub new to change the default behavior. The default behavior is
that the application quits as soon as the startup Form has been closed. The
new sub main can be:

sub main 'outside a module it must be Shared Sub Main
dim f as new form1
f.show
application.run()
end sub

When you want the application to quit, call Application.ExitThread in order
to exit application.run.
 
Stan,

1.) Form.ParentForm ' Gets forms parent

2.) Form.ParentForm.Dispose() 'Removes forms Parent Form

** Note **

No disrespect but, It would not do you any harm to look at an objects
properties in the help before you ask these questions, you will learn an
awfull lot by doing this. Use the resources available like MSDN / GOOGLE /
VS HELP to try and assist you.


Regards - OHM





Hi,
How to know which form has called the current form ?

Btw, when I load a form, how to close the current form that call the
new form ?

Stan

Best Regards - OHMBest Regards - OHM (e-mail address removed)
 
You make it to easy. Where's the adventure in that :)

ps I love oo, spend half my time throwing away perfectly good code!
 
Back
Top