Closing previous form

  • Thread starter Thread starter Eagle-i
  • Start date Start date
E

Eagle-i

In Visual Studio.Net I've created 2 forms for a Windows app using VB.Net -
lets say the forms are frmAlpha and frmBeta

By default the app opens in frmAlpha. On button click I want to go to
frmBeta (I declare frmBeta as a new form near the top of frmAlpha and in
the click procedure I just call form.show(). It works. So far so good.

But, I want frmAlpha to CLOSE as soon as I've clicked to frmBeta. How do I
close it????
 
Hi Eagle,

There are two methods used in this newsgroups.
- some use an extra module sub Main to control the forms
- some use the included sub Main from the form in the Form class.

(When you have no module Main with application start than you use the second
one).

Your situation is a good situation to use the first, however not mine
method.

What I would do is making your second form your mainform and start in that
one in the load event from what you now call your first with a show.dialog
(that is a nice method for a splash form where you in my idea are after)

I hope this helps?

Cor
 
The only thing is ... I would really like to CLOSE that form rather than
hide it. And with me.close(), the whole application closes. Any
suggestions Mark?


Mark Wills said:
Try this :-)

Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As
System.EventArgs) Handles Button1.Click
 
Back
Top