Still celebrating National IT Professionals Day with 3 months of free Premium Membership. Use Code ITDAY17

x
?
Solved

linking to a new from on vb.net

Posted on 2007-04-11
10
Medium Priority
?
182 Views
Last Modified: 2010-04-23
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
0
Comment
Question by:tryokane
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 5
  • 3
  • 2
10 Comments
 
LVL 8

Expert Comment

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

0
 
LVL 2

Author Comment

by:tryokane
ID: 18889805
no i mean i just want to click on the button and go to that form
0
 
LVL 64

Accepted Solution

by:
Fernando Soto earned 200 total points
ID: 18889827
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
Concerto's Cloud Advisory Services

Want to avoid the missteps to gaining all the benefits of the cloud? Learn more about the different assessment options from our Cloud Advisory team.

 
LVL 2

Author Comment

by:tryokane
ID: 18889870
i created another folder and a form in it, now i want to link to that form
0
 
LVL 64

Assisted Solution

by:Fernando Soto
Fernando Soto earned 200 total points
ID: 18889913
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
 
LVL 8

Assisted Solution

by:doraiswamy
doraiswamy earned 50 total points
ID: 18889921
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
 
LVL 2

Author Comment

by:tryokane
ID: 18890024
I actually want to do something like this

button1_Click
GoTo(A Form i created)
0
 
LVL 64

Expert Comment

by:Fernando Soto
ID: 18890079
You need a reference to the form you created and then do the following.

    ReferenceToForm.Activate()
0
 
LVL 2

Author Comment

by:tryokane
ID: 18890115
any code samples on this?
0
 
LVL 2

Author Comment

by:tryokane
ID: 18890849
thx solved it though
0

Featured Post

Independent Software Vendors: We Want Your Opinion

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Introduction As chip makers focus on adding processor cores over increasing clock speed, developers need to utilize the features of modern CPUs.  One of the ways we can do this is by implementing parallel algorithms in our software.   One recent…
Introduction When many people think of the WebBrowser (http://msdn.microsoft.com/en-us/library/2te2y1x6%28v=VS.85%29.aspx) control, they immediately think of a control which allows the viewing and navigation of web pages. While this is true, it's a…
Video by: ITPro.TV
In this episode Don builds upon the troubleshooting techniques by demonstrating how to properly monitor a vSphere deployment to detect problems before they occur. He begins the show using tools found within the vSphere suite as ends the show demonst…
Visualize your data even better in Access queries. Given a date and a value, this lesson shows how to compare that value with the previous value, calculate the difference, and display a circle if the value is the same, an up triangle if it increased…

704 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question