Tutorial: Programming in Visual Basic 6.0

This tutorial contains a beginner’s guide to Visual Basic 6.0, introducing the programming environment, defining key terms and introducing exercises to demonstrate the five control structures…

Organising your first project. The first step is to create a project template within VB, to organise and store your work. This will consist of a menu structure with headings that will let you access the many exercises and examples you complete. Activity 1 • Open VisualBasic 6.0 • Use the file menu to open a new project with a blank form. • Use the properties window to set – Main.frm as the form name. – My programs as the caption. – BackColor to White. – BorderStyle to Fixed Single. – WindowState to Maximised. • Find the Menu icon and click on it to select it. Enter the following menu headings: Quit Introduction with indented subheadings of Example1 Example2 Click OK after each menu caption and name are typed. • Click on Quit menu heading and enter the following code. This procedure is used to exit from running the project display and return to the design screens. • Use the function key to run the application to verify that the Menu structure is correct and that the Quit procedure is free from error. • Use the File menu to save your work as Main.frm and (your intitials)Project1.vbp • Use the file menu to open a new blank form (or the properties window) • Set the following form properties: form name as Welcome, caption to Example1, BackColor to White, BorderStyle to Fixed Single, WindowState to Maximised. • Click on the Example 1 main menu heading and enter the following code:… • Save your work and run to ensure that it is free of errors. • Add two labels, an image and a command button to create a welcome screen. To do this Select label icon from the toolbox. Click towards the centre-top of your form and position and resize your label as required. With the label selected, use the properties window to Change the caption to WELCOME TO VISUAL BASIC Choose a bright back colour Set the font (Arial, underline, alignment centred, size 24 point, forecolour blue) Repeat to add the Enjoy label. Use the image icon on your toolbox to add the image to your form. Use the properties window of the image to select a picture. Use the command Button icon to add the button. Change its caption to RETURN. Then double-click the button and add the following line of code after the Command1_Click() procedure. • Use the file menu to save your work and use to run the application. • DON’T FORGET TO SAVE (AND BACK UP TO FLOPPY) ALL YOUR WORK…

Source: http://www.hsc.csu.edu.au/

Download Tutorial: Programming in Visual Basic 6.0

Leave a Reply