VB Tutorials Part 1 - Making My first Program

Here you will find tutorials that will help you with programming.

VB Tutorials Part 1 - Making My first Program

Postby locohacker » Fri Feb 17, 2006 2:41 pm


Ok, lets get this started this is for absolute newbies :) I going to show people how to lear visual basic the easy way. How i did it anyways 8)

First if you going to be doing basic programming like me forget about books, they just a waste of time I read a book to try to learn VB and it confuse me more then anything :) but if you think you want to do advance stuff I guess books is the way to go.

Aigh here we go first get VB 6 search on yahoo or better yet buy it on limewire :wink:

So Now you have the program install and we ready to start, we going to make a real basic program I want to do this because i want you guys to get the feel of vb and to see how easy it can be,

First we start VB and the first screen you will get is this

Image

Now here we going to select Standard EXE it should be already selected then you press Open

Now you come open the next screen I can fit everything so I going to devide the pic into two on the left you will see this

Image

And on the right you will see this

Image

Okie so lets get started you see this is the form where we put all the command buttons, textboxes ect..

Image

Now this is going to be an easy program all its going to do is send a pop up messege saying my first program, its easy as hell :) but I am tellign you it,s going to take you a long way on undertanding vb :)

First it be best to make the form smaller, so put the mouse on the form blue borders and drag it to the desire size, it's the same as making a windows windows smaller or bigger ):

Ok now we must select a command button from the components box I am talking about this


Image

The components box has all the things you need to create the program such as text boxes, buttons ect.. :)

Ok now er going to select a command button which is located on the area surrounded by the red circle in this pic

Image

Click on it then move the mouse on top of the form you will see something like a plus sign click on the form where you want to put the button

now your form should look similar to this,

Image

You see the command button has some blue squares around them, well you drag those to resize the command button :)

Ok now we ready to put some code on the command button

Click on the command button and this screen should pop up

Image

now we going to enter this basic code between Private Sub Command1_Click() and End Sub
enter this code

MsgBox "My first program"

it should look like this

Image

See how easy you just made a program :) now lets test our program
on top of vb you will see a play button i am talking about this

Image

Click on that and the program should pop up, now click on the button and the messege box saying my first program should pop up.

there you go :)

now lets compile the program you know to make it an exe so people can use it. fist stop the program, click on the stop button right next to the play button.

then we click on File on the top right of vb this window should come up

Image

you see where it says Make Project1.exe click on that now a pop up with the Make project save box shoudl come up, there where it says File name enter the name you want for your program and ended with .exe for example you want to name your program first you will type first.exe on the box then press Ok, it should compile it, Ah make sure to remember which folder you compile it so you can run it and try it lol. aigh so go to the folder where you compile it and click on the first.exe and there you go your first program

:)

Now before you close vb save the vb source code of your program, click on file again and then on save as, and save it that way :) so incase you want to comeback and make changes to it. you just go where you save the vb source code and click on it and you ready to edit some more.

as you can see vb is easy and I going to make more tutorials to help u understand even better so keep on checking the forums :)
User avatar
locohacker
Site Admin
Site Admin
 
Posts: 4325
Joined: Fri Dec 31, 2004 6:59 pm

Postby NVYE » Fri Feb 17, 2006 10:55 pm

My guessing is that you're bored!
User avatar
NVYE
imFiles Senior
imFiles Senior
 
Posts: 230
Joined: Fri Jun 10, 2005 11:29 pm

Postby locohacker » Sat Feb 18, 2006 10:59 am

lol yeps :) and I want new peeps to start programming cause school started and my time is limited, so I hoping other peeps upgrade the programs :)
User avatar
locohacker
Site Admin
Site Admin
 
Posts: 4325
Joined: Fri Dec 31, 2004 6:59 pm

Postby DarkSideHacker » Fri Mar 31, 2006 12:11 am

thanks loco that realy helped i didnt kno about that i kno how to design da program but not make it but yeh thanks man :o
DarKSiDEHackeR iz bAcK
User avatar
DarkSideHacker
imFiles Newbie
imFiles Newbie
 
Posts: 7
Joined: Tue Jan 31, 2006 8:49 pm
Location: Jacksonville Florida

Postby richous05 » Thu Apr 20, 2006 6:33 pm

wow gr8 tutorial i didnt think it was that easy thought it was like hours and hours of endless code to do 2 functions then you have to build a graphical interface but you dont :D im just borrowing vb 6 from rapidshare :) im gonna try and if i do ill continue practising and hopfully be a sucessful vb programmer and it will be all thanks to you.
User avatar
richous05
imFiles Newbie
imFiles Newbie
 
Posts: 10
Joined: Thu Apr 20, 2006 12:55 pm
Location: Fleetwood, Uk

Postby locohacker » Fri Apr 21, 2006 7:15 pm

Glad we could help and if u need more help just ask :)
User avatar
locohacker
Site Admin
Site Admin
 
Posts: 4325
Joined: Fri Dec 31, 2004 6:59 pm

Postby MrAl3n » Sun Jun 04, 2006 12:56 am

pretty easy now

hey loco why do i keep gettin run time error

Code: Select all
Private Sub Command1_Click()
Dim window As Long

On Error Resume Next
window = FindWindow("my window class", vbNullString)
PostMessage window, WM_COMMAND, 33027, 0
End Sub
When life gives you Questions. Google has Answers. ^_^
User avatar
MrAl3n
Co-Admin
Co-Admin
 
Posts: 140
Joined: Mon May 22, 2006 11:04 pm
Location: China

Postby locohacker » Sun Jun 04, 2006 8:41 am

what the error says?

like item not define or something like that :?:
User avatar
locohacker
Site Admin
Site Admin
 
Posts: 4325
Joined: Fri Dec 31, 2004 6:59 pm

Postby null » Sun Jun 04, 2006 11:27 am

LOL


Code: Select all
Dim window As Long

On Error Resume Next
window = FindWindow("my window class", vbNullString)
PostMessage window, WM_COMMAND, 33027, 0


well if you dont declare the function then its going to error.

this needs to be delcared...
FindWindow
PostMessage
WM_COMMAND

without them decalred it wont.
null
 

Postby MrAl3n » Sat Jun 10, 2006 10:39 pm

Ok Thanks ... Got It :D
When life gives you Questions. Google has Answers. ^_^
User avatar
MrAl3n
Co-Admin
Co-Admin
 
Posts: 140
Joined: Mon May 22, 2006 11:04 pm
Location: China

Postby nikka » Wed Jun 28, 2006 7:29 pm

this is east the hard thing is coding lol whice u need to get books for that
nikka
imFiles Newbie
imFiles Newbie
 
Posts: 17
Joined: Fri Jun 23, 2006 3:09 pm

Postby null » Wed Jun 28, 2006 8:42 pm

no i never learned from books i learned from exsamples... there again everybody learns things diffrently some people need books to learn from. and if you have problems reading like me for exsample then books is not for you exsamples of others codes are good to learn from. however learning from others codes the code has to be clean or you needs atleast some years with crappy code to understand jibberish code.
null
 

Postby roy » Wed Jun 28, 2006 8:59 pm

so wen is the next tuturiol cumin up, i wana try my skills or try 2 learn it, well i started off wid c++ lets c where i'm headed.
User avatar
roy
imFiles Senior
imFiles Senior
 
Posts: 106
Joined: Sat Feb 25, 2006 6:49 pm

Postby poison » Sun Aug 13, 2006 2:24 pm

:oops: loco...you got me interested again with creating programs and websites...i graduated as a computer tech. @ heald college but never had a chance to use my profession...so i guess i'll just use it here instead...i still have some of my projects back then when i was still in school...i'll just review them as my reference...thanks man!
User avatar
poison
imFiles Newbie
imFiles Newbie
 
Posts: 16
Joined: Sat Jul 15, 2006 11:52 am
Location: Bay Area, CA.

Postby locohacker » Sun Aug 13, 2006 10:22 pm

You welcome its cool to program when we gots the time it keeps me from being bore i go crazy when i am bore so i program instead :)

and share ur proggies with us when u do man :)
User avatar
locohacker
Site Admin
Site Admin
 
Posts: 4325
Joined: Fri Dec 31, 2004 6:59 pm

Next

Return to Programming Tutorials

 


  • Related topics
    Replies
    Views
    Last post

Who is online

Users browsing this forum: No registered users and 0 guests