TUTOR

Book Marks:-

I know zip about Visual Basic but I want to learn how to use it.

Coming soon:

I know the basic workings of it now, tell me some commands.

Show me how to manipulate the form to add a title, buttons ect...

Creating a sample program, Compiling and running your work.

Finally making distribution disks + odds and ends that I did not know where to put


Lesson 1 (Start)


What is VB?

Visual Basic is a form of programming that lets you program in the windows state, for example the program Paint. This is a very good program and it could be quite easily be made in VB. When any one who has not used VB thinks of programming they could often think of a black screen with white righting going down it eg:-

This is in fact what programming was like before VB came out, this image is of a program called BBC basic. VB on the other hand does not work in DOS but as a windows application making it much easier to use, and you can get much better results. The way in which you program is different in VB as you use something called a Form to program on:-

The form is the actual part of the program you would see if running it would look just as this one does but it would be with out the marker dots. To this form you can add controls like a button or a text box whatever you want, these controls can then do other things which you will find out about in the next part...

How To Create A Very Simple Application

To create an application or exe file you need to know your way around VB the primary selection tool for VB is the TAB box on the left hand side of the screen which looks something like this:-

The small empty button on the TAB box is the tool for creating buttons if you click on this tool and then drag out a box on the form you will get a button that has something like Command1 inside it. If you then go to the menu bar at the top and click RUN and then START you will see the form with the button in it. Click on the button nothing will happen but it will go up and down just like any button in windows:-

To stop the program click on the cross on the top of the form and you will go back into the VB design area. The button you have just created does nothing but this can be solved very easily. Double click on the form and a white box will pop up this is your code window you type your commands you want the box to do in this window. Notice at the top op the window it says Private Sub Command1_Click( ) This means that the button code you have just called up has been set to be clicked on and nothing else. This is good if you only want to click on it once, we will talk about the other options later on. Below this message type the word END. Make sure you have put it in between the Private Sub Command1_Click( ) and the End Sub line of text, otherwise it will not work. Run your program again and this time click on the button once and your program should end. If it does not then go back and read through this bit again to see what you did wrong.

Top