Solved

linking to a new from on vb.net

Posted on 2007-04-11
10
175 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
  • 5
  • 3
  • 2
10 Comments
 
LVL 8

Expert Comment

by:doraiswamy
Comment Utility
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
Comment Utility
no i mean i just want to click on the button and go to that form
0
 
LVL 62

Accepted Solution

by:
Fernando Soto earned 100 total points
Comment Utility
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
 
LVL 2

Author Comment

by:tryokane
Comment Utility
i created another folder and a form in it, now i want to link to that form
0
 
LVL 62

Assisted Solution

by:Fernando Soto
Fernando Soto earned 100 total points
Comment Utility
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
What Is Threat Intelligence?

Threat intelligence is often discussed, but rarely understood. Starting with a precise definition, along with clear business goals, is essential.

 
LVL 8

Assisted Solution

by:doraiswamy
doraiswamy earned 25 total points
Comment Utility
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
Comment Utility
I actually want to do something like this

button1_Click
GoTo(A Form i created)
0
 
LVL 62

Expert Comment

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

    ReferenceToForm.Activate()
0
 
LVL 2

Author Comment

by:tryokane
Comment Utility
any code samples on this?
0
 
LVL 2

Author Comment

by:tryokane
Comment Utility
thx solved it though
0

Featured Post

Highfive + Dolby Voice = No More Audio Complaints!

Poor audio quality is one of the top reasons people don’t use video conferencing. Get the crispest, clearest audio powered by Dolby Voice in every meeting. Highfive and Dolby Voice deliver the best video conferencing and audio experience for every meeting and every room.

Join & Write a Comment

Suggested Solutions

1.0 - Introduction Converting Visual Basic 6.0 (VB6) to Visual Basic 2008+ (VB.NET). If ever there was a subject full of murkiness and bad decisions, it is this one!   The first problem seems to be that people considering this task of converting…
Microsoft Reports are based on a report definition, which is an XML file that describes data and layout for the report, with a different extension. You can create a client-side report definition language (*.rdlc) file with Visual Studio, and build g…
Sending a Secure fax is easy with eFax Corporate (http://www.enterprise.efax.com). First, Just open a new email message.  In the To field, type your recipient's fax number @efaxsend.com. You can even send a secure international fax — just include t…
In this seventh video of the Xpdf series, we discuss and demonstrate the PDFfonts utility, which lists all the fonts used in a PDF file. It does this via a command line interface, making it suitable for use in programs, scripts, batch files — any pl…

772 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

Need Help in Real-Time?

Connect with top rated Experts

9 Experts available now in Live!

Get 1:1 Help Now