opening a windows via a windows

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

hello, i don't know if i'm posting this in the right section .. but heck.

anyhow, is was wondering what code i should use to open a existing form from
an other form.( clicking on a button and then getting the next one, whil
closing the other one.)

thanks in advanced,
Peace.out.
 
angus said:
anyhow, is was wondering what code i should use to open a existing form
from
an other form.( clicking on a button and then getting the next one, whil
closing the other one.)

\\\
Public Module Program
Public Sub Main()
Dim f As New Form1()
f.Show()
Application.Run()
End Sub
End Module
///

In the project properties, select 'Sub Main' as startup object. Place the
code below in a button's 'Click' event handler:

\\\
Dim f2 As New Form2()
f2.Show()
Me.Close()
///

You can exit the application by calling 'Application.ExitThread'. Take a
look at the 'ApplicationContext' class too.
 
Herfried,
I doubt that this is a good idea...
Are you real in doubt of that?

Here the correction.
\\\
Dim frm As New Form2()
frm.ShowDialog(me)
frm.Dispose()
///

:-)

Thanks for the attention.

Cor
 
Angus,

Of course you only have to place in that button event
\\\
Dim frm As New Form2()
frm.ShowDialog(me)
Me.Dispose()
///

I hope this helps?

Cor
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Back
Top