stu nicholls dot com | menu - Professional dropdown #3

click here


Adding new Forms to the project

You can add many forms to your Project. To add a new form to your Project, go to Project | Add Windows Form. In the resultant dialog box you can give the name which you want to this Form. Thus you can add various forms to your Project and can give different functionalities to these Forms.

Setting up of Startup form

When you have added many forms to your Project then you need to set up the Start Up form for the execution of a desired form at the time of execution of the Project. To do this in the Solution Explorer Window double click on to My Project you will get the screen as shown in Fig. 14. Here you can select the Form which you want to execute when you run your project from the ComboBox labeled as Startup Form


  1. Program to reverse an integer and to find the sum its individual digits
  2. Public Class ReverseDigits
    Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles
    Button1.Click
    Dim j, n, rev, sum As Integer
    n = TextBox1.Text
    rev = 0
    sum = 0
    While (n > 0)
    j = n Mod 10
    rev = rev * 10 + j
    sum = sum + j
    n = n \ 10
    End While
    TextBox2.Text = rev
    TextBox3.Text = sum
    End Sub
    End Class
  3. Program to find the number of vowels
  4. Public Class Vowels
    Dim strn As String
    Dim c As Char
    Dim len, i, vowels, others As Integer
    Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
    i = 0
    vowels = 0
    others = 0
    strn = TextBox1.Text
    len = strn.Length
    While (len > 0)
    c = strn(i)
    Select Case c
    Case "a"
    vowels = vowels + 1
    Case "e"
    vowels = vowels + 1 Case "i"
    vowels = vowels + 1
    Case "o"
    vowels = vowels + 1
    Case "u"
    vowels = vowels + 1
    Case Else
    others += 1
    End Select
    len = len - 1
    i = i + 1
    End While
    TextBox2.Text = vowels
    End Sub
    End Class


<< Previous


comments powered by Disqus
click heres
click here
click here
Footer1