60 likes | 185 Views
This guide provides a comprehensive introduction to Visual Basic (VB) programming for students in the course 6303. It covers the essentials of creating console applications using Visual Studio 2005, including setting up projects, declaring global variables, writing subroutines and functions, and managing file output. Additionally, the guide explores the fundamentals of Windows applications, emphasizing event-driven programming, using the toolbox, and managing multiple forms. Learn how to manipulate controls, handle events, and enhance your applications with images through practical examples.
E N D
Introduction to VB programming By Dr. John Abraham For students in 6303
A console program • Start Visual Studio 2005 • Click create Project • Click project type Visual Basic (left side) • Click on console application • Give it a name and Press OK • Change the name of the module
VB console program • Declare global variables and constants • Write subroutines and functions • Must have a subroutine called main • Pass parameters properly. Observe Byval and byRef • Run the program
Writing to a file • Imports system.io • Declare a variable of type io.streamwriter • Dim outfile as io.streamwriter • Assign a physical filename to create • Outfile=io.file.createText(“c:\outfile.txt”) • Write to file • Outputfile.writeLine(“this is a sample”) • Sample program - carpet
Windows program • Click on Windows application instead of console • Learn how to use toolbox • Learn to set properties • Learn to write code for events • Learn Looping for this example • (Interest program)
Multiple Forms • Learn how to manipulate more than one form • Making visible invisible • Set focus • Learn how to add pictures • Sample program: cards