Jump to content

[Guide]Make your own simple programm with visual basic.


Freyr

Recommended Posts

I have decided to make one guide for newbies which are beginners in visual basic programming.

 

Should we begin? Ok

 

Open your Visual Basic.

We will make one simple game called Annoying Button Game.

 

Start a new project as you can see there:

6oe6aq.jpg

After you started a project you will see one window with many options.Select the Windows Forms Aplication,rename it to "Annoying Button Game"without " and click ok.

acv347.jpg

When you click ok,one window will appear called Form1.

Click on this Form1 one time with your mouse.Not double click,,,one time only.

When you clicked,at the right site you will see the Form1's properties:

29h4yc.jpg

Pull your mouse down and try to find ''Text''.

When you find it,you will see it is called "Form1":

2qv4jrs.jpg

Just rename it to "Game"and press Enter.

Ok our form now is called Game.

After go to properties again and try to find "FormBorderStyle"you will see it says Sizable.Click on downarrow and select "FixedSingle".

259bptd.jpg

Go again and try to find "Maximize Box".You will see it is True.Change it to False.

After find "Minimize Box"it is exactly down after maximize box.Change it to False too.

After find the "ShowIcon" and set it to False too.

After find the "ShowInTaskbar"and set it to False too.

After find "TopMost" but this time set it to True!

After find size and copy what i shows you: 405;332 .

When you do all this the Form1 or Game which we called it,will looks something like this:

16p0ki.jpg

 

Ok.We finished the easiest part.

Now is coming the hardest part :)

 

On the left side you will see the toolbox.:

1zpimi1.jpg

Open it and try to find one option called "Button".:

og51g.jpg

Double click on it,and the Button will appear on the Form.:

29p6ot5.jpg

Ok.

Now go to the button's properties,and try to find Text.

Rename it to "Click Me!" and press Enter.

Now go again to the Toolbox (on the left side you know)and try to find the "StatusStrip":

2hxbo6c.jpg

Double click on StatusStrip and it will appears at the down side of the Form.

There are one option there.

Select the option:StatusLabel.:

5zk0wp.jpg

After go to it's properties and change it's text to "0".

Finaly,go to the toolbox and try to find the "Timer".:

2ihmpkx.jpg

Double Click on it and it will appear (not in form but down of the form,at the blank).

5vukvl.jpg

Go to his properties and find the "Enabled"Set it to True.

After go to "Interval" and change it from 100 to "1000".

When you do all this parts the form should look something like this:

2mxehit.jpg

 

In the next part you must give careful attention!

 

Double click on timer down on the blank.

2qwfotv.jpg

Now copy this which i give you:

 

Dim RND As New Random

        Button1.Location = New Point(RND.Next(1, 270), RND.Next(1, 270))

 

 

Check if all is good without error!

If all is allright,it will be something like this:

6hs6iu.jpg

Ok now go back to your Form from here:

rk6a7q.jpg

Click there and you will be bringed back to your Form.

Now Double Click on the button.You will see something like this:

23nr6a.jpg

Now i will give you code to put again:

 

If Timer1.Interval = 50 Then MsgBox("You Won!") : End

        MsgBox("HaHa Faster!")

        Timer1.Interval -= 50 : ToolStripStatusLabel1.Text += 50

 

 

When you finish it,it will be looks something like this:

52x2qh.jpg

Then go up and you will see this green button which i show's you in picture.

Click on it,to test your programm.

Click on click me,and when you click your score will become 50.Now the button is running faster.You must click again and again etc...

 

Allright.You finish your programm.

Now you must build it.Go up at the Build option select the "Build Annoying Button Game".:

15cbosk.jpg

When you press it,look down at the right site and you will see,it says Build Succeeded.:

erif53.jpg

Now you must save it.

Go again up and you will see this button:

1626skj.jpg

When you press button one window will appear,which has writed the name,and the location of your save.When you choose those 2 options press save.

Ok.

Now your file has been saved to:My Documents/Visual Studio 2008/Projects/Annoying Button Game(or whatewer name you choosen)/Annoying Button Game/obj/Debug/or Release/Annoying Button Game.exe

Run it and look what you mate!

Congratulations,you make your own programm.

 

Attention!

This programm is only one example of all other programms you can make.

If you want to create another programm then never forget these words:

Dim,If,As,Then.

 

Credits to me for the Guide.Visual Basic for the programm and to www.tinypic.com for upload my pictures.

 

Good Programming and have fun!

 

/center]

Link to comment
Share on other sites

Why everyone is using the express edition... LOL Lucky me I'm using the VisualStudio with C++ etc :P

 

Anyways I think it's a good guide for newbies but they wouldn't understand any of it just writing some code without understanding any of it :P

 

Btw you should learn more VisualBasic ^^

Link to comment
Share on other sites

Link to comment
Share on other sites

Please sign in to comment

You will be able to leave a comment after signing in



Sign In Now


×
×
  • Create New...