ITSourceCode.com

We Exist to Provide 100% Free Source Code and Tutorials

Custom Search

11-Linking Forms

How to link multiple Forms? Linking form to another is not a major technical problem for most programmers who have been working without default instances of non-form classes for so long. If you are used to building Windows applications using Visual basic, well it’s a big change. This change is that you need to have a reference to a particular instance of a form for you to be able to use it.

 

This is the example on how to link a Fom:
Open Visual basic 2008 and create a new Windows Form Application. After that, select a Button in the toolbox and drag it into the form. Change the text property of a Button into “Show Form2”.

lForm1

Click the solution explorer and right click the Windows Application that you have created. Select “add” and choose “Windows Form” to add another form.

lForm2

The dialog of Add New Item will then appear. Do the process just like the figure shown below.

lForm3

Now, you already have two Forms in the windows application. Go back to the form1 and double click the button to fire the click event handler of it and do the following code.

  1. Form2.Show()

This is how you link a form to another form.

 

The code in the view code will look like this.

  1. Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
  2. Form2.Show()
  3. End Sub

 

Facebook Comments

Check Your Domain Ranking

Leave a Reply

Your email address will not be published. Required fields are marked *

ITSourceCode.com © 2016 Frontier Theme

Subscribe For Latest Updates

Signup for our newsletter and get notified when we publish new articles for free!