linking to a new from on vb.net

vb.net i want to link a button to a new form on the same project to another form on the same project what code can i use to do this
LVL 2
tryokaneAsked:
Who is Participating?
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

doraiswamyCommented:
by link, do you mean, when you click this button, it should raise an event on the other form?

0
tryokaneAuthor Commented:
no i mean i just want to click on the button and go to that form
0
Fernando SotoRetiredCommented:
Hi tryokane;

Not sure what you mean. The following code when placed in a button click event will create a form of type MyNewForm.

    Dim nForm As New MyNewForm
    nForm.Show()

If this is not what you want please let me know.

Fernando
0

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
Amazon Web Services

Are you thinking about creating an Amazon Web Services account for your business? Not sure where to start? In this course you’ll get an overview of the history of AWS and take a tour of their user interface.

tryokaneAuthor Commented:
i created another folder and a form in it, now i want to link to that form
0
Fernando SotoRetiredCommented:
Hi tryokane;

This should do what you want

    Private nForm As MyNewForm = Nothing

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

        If nForm Is Nothing Then
            nForm = New MyNewForm
            nForm.Show()
        Else
            ' Give the form nForm the focus
            nForm.Activate()
        End If


Fernando
0
doraiswamyCommented:
I think you mean you want to use a form in another project at design time.
Yes that is possible.
Right click on your project name in the Solution Explorer, select Add Existing item, and browse to the folder where the other form is.
0
tryokaneAuthor Commented:
I actually want to do something like this

button1_Click
GoTo(A Form i created)
0
Fernando SotoRetiredCommented:
You need a reference to the form you created and then do the following.

    ReferenceToForm.Activate()
0
tryokaneAuthor Commented:
any code samples on this?
0
tryokaneAuthor Commented:
thx solved it though
0
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
Visual Basic.NET

From novice to tech pro — start learning today.