Hi,
I build a login form and want when user click on submit button then other form show. I also add new form by file->add->new project
I use the name of 2nd form which is (welcom.vb) in the coding of submit.
the coding of submit button is

Public Class Form1
 Private Sub Button1_Click(sender As Object, e As EventArgs) Handles Button1.Click
     welcom.show();
 End Sub
End Class

but compiler show error on welcom.show() line. It says you have to first declare the form welcom
and when i declare it as

 dim welcom as new form
 welcom.show()

then it shows only empty form
i want to link welcom form with submit button, how should i do this.

Thanks

It should be
welcom.show() without (;)

This should work fine

Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
   welcom.Show()
End Sub

When you name your form "welcom.vb", it generates a class welcom. To access this form you will have to use welcom rather than form.

The second method will work fine too after a small correction

Dim a As New welcome  ' instead of Dim welcome As New form
a.Show()

Dim abc As New formwill make a new form with the name abc

Hope it helps :)

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.