Introduction to VBprogramming
Dr. John P. Abraham
UTPA
Chapters 2 & 3
Continued from last week’s demo
Difference between label and text boxes
Properties window
Changing name and text
Border Style
AutoSize
BackColor
Font Size
Visible
TabIndex
Solution Explorer
Show all files
Visual Basic Controls
Choose Windows forms application
What you see is the IDE (IntegratedDevelopment Environment)
Use Sizing handle to make the form
Adjust the size of the properties window
Tac the toolbox
Use common controls
Start placing objects on the form
Place a button, label it Exit and add codeme.close()
Applications
Console
Output appears in console window
From Visual studio choose VB and choose anew project, and choose Console Application,Give it a name.
Follow Chapter 3.
Window
Demo of Hello program
Dim name As String
        Console.Write("Please Enter yourName > ")
        name = Console.ReadLine()
        Console.Write("Hello " & name & "!")
        Console.ReadLine()
Adding a pop-up message box
Add a form to the application
Add this line
MessageBox.Show("Hello " & name & "!","Show Message")
Discuss Assignment that wasturned in
Explain input
Public Class FrmBreak1
    Dim num As Integer
    Private Sub Button1_Click(ByVal sender AsSystem.Object, ByVal e As System.EventArgs)Handles btnReadNum.Click
        num = InputBox("Enter a Number", "ReadNumber")
        lblNumber.Text = num
    End Sub
End Class
Program submission
Program print out
Program Run
Place them in a manila folder
Writing to sequential file – For Future Submissions
Imports System.IO
Public Class SeqFileWrite
    Dim fileName As String
    Dim fileWriter As StreamWriter
    Dim output As FileStream
    Private Sub btnFileSave_Click(ByVal sender As System.Object,ByVal e As System.EventArgs) Handles btnFileSave.Click
        fileName = txtFileName.Text
        output = New FileStream(fileName, FileMode.Create,FileAccess.Write)
        fileWriter = New StreamWriter(output)
        fileWriter.WriteLine("Hello World")
        fileWriter.WriteLine("My Name is: John Abraham, Now thisworks.")
        fileWriter.Close()
    End Sub
End Class