Tuesday, November 08, 2011

A Cool Visual Basic Project

For those of you who hadn't figured it out, the VB in VB Kid stands for Visual Basic. Its not the best programming software but its my favorite and I'm going to show you a cool project you can make and have some fun with your friends...

I call it: The Meaning of Life...

I used Microsoft Visual Basic 2010 Express. If you don't have it you can get it here.

OK, so lets start...
First you'll have to open Visual Basic. Then create a New Project and select Windows Form Application. When it creates you should see this:

New Project Window

Next click the Form and go to the Properties Window on your right and change the following:
Size:
       Width:581
       Height:482

Text: What Is The Meaning Of Life?

The Properties Window


Now go to the Toolbox and select the Button icon and drag it to the Form window. This creates the button required for the project
The Toolbox

Now click on the button and go to the Properties Window and change the following:
Location:
               X: 64
               Y: 323

Size:
        Width: 437
        Height: 54

Text: Click Here For The Meaning Of Life


Next click the events icon (red/orange lightning bolt) on the top bar of  the Properties Window and new items will appear. Scroll down(the Properties Window) until you find MouseEnter. Double-Click on the blank space to the right of this text then a menu will show up.
Next type this code into the menu:

Public Class Form1
    Private Sub Button1_MouseEnter...        
        If Button1.Top > 150 Then
              Button1.Top = 50
        ElseIf Button1.Top <= 150 Then
            Button1.Top = 300
        End If
    End Sub
End Class

*Blue text will be typed already so don't worry too much about it and don't mess with it.*
*Orange text will change color as you type*

When you're done it should look like this:

Now click the Run/Play icon at the top and try to click the button....Cool huh?
I bet now you want to share your little application.

To do this click Debug at the top of the window then click Build. You're done!
You'll find your project in the folder where you save you projects.
For me its under C:\...\Documents\Visual Studio 2010\Projects\MeaningOf Life\MeaningOf Life\bin\Release\
 Its the executable in that folder.
*blue text depends on what you save your project as*

YOU CAN CHANGE COLORS, FONTS AND BACKGROUNDS TO YOUR LIKING.

That's Pretty Much It: The Meaning Of Life...

Your VB Kid
Psypher



0 Codes:

Post a Comment