Jump to content


Photo
- - - - -

[vb] - [your First Program] - [ronson]


  • Please log in to reply
3 replies to this topic

#1 ronson

ronson

    Banned For Being Purple

  • Twodded Staff
  • PipPip
  • 480 posts
  • Gender:Male
  • Location:North Yorkshire, UK
  • Interests:Rugby, Programming, Building Computers, Networking, Web Design and...........BINGE DRINKING!!!!!!.

Posted 06 May 2005 - 12:24 PM

You’re First Ever Program

Well, I doubt I anyone actually waited but oh well, here is the second part of my Visual Basic Tutorials.

Hello Message Box

Open up Visual Basic and click on “Standard Exe”.

When this has loaded up either double click on Command Button or click it once and draw a command button on like so.

Posted Image

Click once on your Command button and then go to you’re Properties Box and find you’re click in the box next to Name, Insert “cmdHello” and an the caption box that is 4 rows down, insert “Hello”.

Posted Image

A brief explanation of “cmdHello” the ‘cmd’ stands for Command and the ‘Hello’ is a VERY short description of what the button is going to do, you do this so that when it comes to coding big programs you know what control does what.

Now if you click Run > Start, you will notice the button does nothing…That’s where the coding comes in double click on the command button and the code window comes up, type “MsgBox(“Hello”).

Posted Image

Now what the code means, Msgbox is what creates the actual box, and the word hello is the text displayed in the box, but make sure you have the text in speech marks. You can also write the code like this

Private Sub cmdHello_click()
MsgBox "Hello"
End Sub

It’s a different way but in the end it’s the same result. Now click Run > Start and click the button and this is what you should get.

Posted Image

To create you’re program and save it to a .exe click File > Make project.exe.

Congratulations! You now have you’re first working program.

#2 Smarty

Smarty

    Young Padawan

  • Members
  • Pip
  • 67 posts

Posted 15 May 2005 - 01:18 PM

This will help me when I get Visual Basics back up!

Good Tutorial! ;)

#3 ronson

ronson

    Banned For Being Purple

  • Twodded Staff
  • PipPip
  • 480 posts
  • Gender:Male
  • Location:North Yorkshire, UK
  • Interests:Rugby, Programming, Building Computers, Networking, Web Design and...........BINGE DRINKING!!!!!!.

Posted 17 May 2005 - 06:22 PM

Why thank you! I don't like the tutorial i find it boring but then again, people gotta' learn to crawl before they can walk :D

Thanks again dude!

#4 Kaltenberg

Kaltenberg

    Young Padawan

  • Members
  • Pip
  • 11 posts

Posted 06 April 2006 - 09:17 PM

Thanks, im gona try it on my other computer. Im starting to get into VB this helps me alot.




0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users