Thursday, 13 August 2009

Starting Visual Basic

On Friday, our teacher explained and went through with us step by step how to get started on Visual Basic.
It was luckily already installed.
So this is the process to make a new project:
1. File
2.New Project
3.Windows Forms Application
4.Name the Project
Then came:
- object
-property
-events
Explain in each detail:
OBJECT
So once the project opens, it displays a medium sized box and this is named Form 1.
When talking about Objects, it means everything in the toolbox.
Firstly I created two buttons.
* Button 1
* Buttone 2
Then I added a label
* Lable 1

PROPERTIES
When talking about properties, it means the properties of the buttons, the label and the form. So I am able to rename the button and the label as well as the Form. So now my buttons are named:
*Mr Button 1
*Mr Button 2
*Mr Label
As for the background of each object. For my buttons, I went to Forecolour, there were quite boring colours, but if you go to Custom there are much more "colorful" colors.
The for my label, I did the same thing as I did for my button. Another property I cahnged was the font, font style as well as font size.
As for my form, you could change the colour of the background or could insert a background color, I decided to insert a picture of the sunset.

EVENTS
When it came doing this, well the whole thing just, how could you say it? - Stuffed Up. Basically you had a code, for button 1, button 2 as well as Label 1. So when you clicked on say for example Button 1, Label 1 would disappear and if you pressed Button 2 it would reappear. Quite cool!
We also have to add a radio button, but I havent got to do that, so when I do I obviously will blog all about it.
Anyways, since mine didnt work, as when you clicked the "play" button, some error message would come out. I closed my whole project, saved it and then tried to make a new one. Then since I had so many projects saved, I went to the file Of Visual Basic and deleted these files. Then when I went back to open a new project,my solution explorer didnt open. Then the bell went so I would have to re-install Visual Basic on that. So yeah I learnt many things but unfortunately was unable to make mine work.

So today (Monday) I tried again and now I just have to add the code, and it should work, it will work.
Note: I must get a blank CD and put Visual Basic onto that so I am able to work on it at home.
So yeah that was my first go on Visual Basic.
Sanea.

No comments:

Post a Comment