• Steam recently changed the default privacy settings for all users. This may impact tracking. Ensure your profile has the correct settings by following the guide on our forums.

[vb6]Tutorial 2

Darkchild

The Doctor
Well, here is the tutorial as I promised!

Today we are going to learn about the VB6 GUI!


Q:
What on earth is GUI?
A: GUI stands for Graphical User Interface

Q: How does the VB6 GUI look like?
A: Here's a screenshot:

vb6_1.JPG (Yes, this is THE madamp5 project )

As you can see, there are lots of buttons! And windows and information, What are these for? You're going to learn MOST of them today!

Well...As you can see in the image above, there is a graphical interface designer, where you can put buttons, labels, and etc.. (which we will talk about later on). The window you design in VB is called a FORM.

On the right of the window(the one that has a form) there is a CODE WINDOW


--------VERY IMPORTANT---------

Note :
Visual Basic 6 is a event oriented programming language, so, certain things ONLY happen when you press a button or...move the mouse... Etc...

--------VERY IMPORTANT---------

Now the objects!
vb6_2.JPG
As you can see there are loads and loads of possible objects in visual basic!
and now I will explain the use of ALL of them!
(from left to right)

vb1.JPG First there's the mouse cursor, used for moving/resizing objects.

vb2.JPG next there's the picture box, which is used to show pictures on VB6. (and sometimes for arrays) This component is more advanced than the image component, because it has more functions, let's say it's a Image V2.0 :p


vb3.JPG next there's the label box (Appears as a big "A") this is used to display text with no borders and can have fonts and colors of all type!

vb4.JPG next there's the TextBox, this object is for the user to input data or the program to export data, for example, if you want to make a login screen you need the textbox to write the PASSWORD (one of the proprieties of this object is PasswordChar, which is the character he'll show instead of the normal text! Object Proprieties will be explained later!)

vb5.JPGnext there's the frame, this has no particular usage, except for better organizing your program or making it look more professional!

vb6.jpg And now my favorite object! The command button!!! I love this thing!
It is a button, that's it! You press it, code is executed!:p (I love buttons xD)

Untitled-1_02.gifNow for the checkbox...I think you all know what this is for, you can read/set it's values and it is like a boolean, it can be only true or false (1 or 0 in value)

Untitled-1_03.gifThe option button! as you all know Option buttons allow you to ONLY BE ABLE TO SELECT ONE ITEM, so in each form... you can ONLY have one option for a set of option buttons (this is automatic, by inserting them in a form, they will automatically start working, in a sense that, if you select one, all the others will be deselected!)

Untitled-1_05.gifThe combo box! What is it? I think this screenshot can explain it :
comboboxscreenie.JPG

Untitled-1_06.gifThe listbox! This is a component used for making lists, you can edit/read/add all /alues on the list, can be used for storage of information (Still, variables are safer xD)

Untitled-1_07.gifUntitled-1_08.gif I personally never used these, they are for "scrolling" OR another use for them is adjustable progress bars (in the old days [windows 3.1 days that is] these were commonly used for adjustable progress bars in media players :) )

Untitled-1_09.gifLet's imagine you want something to occur every...let's say...500 milliseconds, it's by using this timer that you will get there!
there are 2 key proprieties in this component which are:
-Interval
-Enabled
in interval, you input the amount of milliseconds you want the timer to execute it's code and in Enabled is if it will keep looping the code or not.

Untitled-1_10.gifDrive list box, a very easy way to get a list of all drives on a computer! :D it works as a combo box, and as a list at the same time, but values cannot be altered! :O This component is "Read Only" if ya know what I mean xD

Untitled-1_12.gifAnother great component, Dir List box, This can be used for old school file browsing/file "recon" :) and as the drive list box, it's read only

Untitled-1_13.gifFile List Box, same as Drive List or DirList it's a list of files bla bla bla read only bla bla bla...

---VERY IMPORTANT!----

NOTE : YOU MUST INPUT WHICH DIRECTORY TO USE IN DIR/FILE LIST BOX!! AND THEN RUN ITS INTERNAL REFRESH FUNCTION!

---VERY IMPORTANT!----

Untitled-1_14.gif You can make shapes on your App, good for decoration, you can make circles, squares, rectangles, etc..!

Untitled-1_15.gif You can make lines too and change their position/look/direction in code, which may be useful!

Untitled-1_16.gif Image, simply for imagery, supports strech too! (and gif (non animated), BMP, WMF, jpg)

Untitled-1_17.gifUntitled-1_18.gif These two... I never used them xD OLE is for objects and the other one for databases :)


Now...WHAT ARE COMPONENTS!

Components are the various "objects" you can put on your program, be it an image, a label, a button, whatever! these are components!

Q: Are these the only ones I can use? :S there's not that many of them....

A: No, fortunately there are more, but there's a catch...For aditional components, you need the corresponding OCX file, if you put that program on a computer that doesn't have the required OCX files, the program WILL NOT RUN!
so be carefull using these!

Now, how to add them:


All you need to do is go to the menu bar and select "project" then components like so :

COMPONENTS1.JPG

and this window should appear:
COMPONENTS2.JPG

now just select what you want, press apply and tadaah!
COMPONENTS3.JPG
new things!!! :O


Well then, that's all for today (Omg!! so many pics and text!!!)

Hope you liked it, be sure to post your questions, if any :)
 

Roe

Well-Known Member
Nope Im going to the internet cafe sometime next week. But I want to be prepared to know what to do when i get it
 
J

Junit

Guest
I still need to get VB6 also LOL , thanks for taking the time and making the guides :)
 

EvilSeph

Administrator
Excellent, lesson 2. As always, corrections or comments are in line and in red:
Well, here is the tutorial as I promised!

Today we are going to learn about the VB6 GUI!


Q:
What on earth is GUI?
A: GUI stands for Graphical User Interface

Q: How does the VB6 GUI look like?
A: Here's a screenshot:

View attachment 2581 (Yes, this is THE madamp5 project )

As you can see, there are lots of buttons! And windows and information, What are these for? You're going to learn MOST of them today!

Well...As you can see in the image above, there is a graphical interface designer, where you can put buttons, labels, and etc.. (which we will talk about later on). The window you design in VB is called a FORM.

On the right of the window(the one that has a form) there is a CODE WINDOW

You should include instructions on how to access said Code Window.

--------VERY IMPORTANT---------

Note :
Visual Basic 6 is a event oriented programming language, so, certain things ONLY happen when you press a button or...move the mouse... Etc...

In theory most programming languages are event oriented. Visual Basic just uses this idea more explicitly. Stating that things only happen if you or the user does something is misleading as this is not always the case.

--------VERY IMPORTANT---------

Now the objects!
View attachment 2582
As you can see there are loads and loads of possible objects in visual basic!
and now I will explain the use of ALL of them!
(from left to right)

You should probably mention that this is called the Tool Box.

View attachment 2556 First there's the mouse cursor, used for moving/resizing objects.

View attachment 2557 next there's the picture box, which is used to show pictures on VB6. (and sometimes for arrays) This component is more advanced than the image component, because it has more functions, let's say it's a Image V2.0 :p

Both have their advantages and disadvantages but I suppose that is too advanced for this tutorial to cover. It would be interesting to see if you possess this knowledge though.

View attachment 2558 next there's the label box (Appears as a big "A") this is used to display text with no borders and can have fonts and colors of all type!

Not always the case, you can add borders etc. (to most objects, actually). But again, probably too advanced for this tutorial to cover.

View attachment 2559 next there's the TextBox, this object is for the user to input data or the program to export data, for example, if you want to make a login screen you need the textbox to write the PASSWORD (one of the proprieties of this object is PasswordChar, which is the character he'll show instead of the normal text! Object Proprieties will be explained later!)

Very nice point to be brought up.

View attachment 2560next there's the frame, this has no particular usage, except for better organizing your program or making it look more professional!

I disagree with this point. The frame is more useful than people think. I think I seriously need to decide how advanced this tutorial should be...

View attachment 2570 And now my favorite object! The command button!!! I love this thing!
It is a button, that's it! You press it, code is executed!:p (I love buttons xD)

To think a command button is simply limited to the functionality of a button is silly :p. You can do so much more with it.

View attachment 2561Now for the checkbox...I think you all know what this is for, you can read/set it's values and it is like a boolean, it can be only true or false (1 or 0 in value)

View attachment 2562The option button! as you all know Option buttons allow you to ONLY BE ABLE TO SELECT ONE ITEM, so in each form... you can ONLY have one option for a set of option buttons (this is automatic, by inserting them in a form, they will automatically start working, in a sense that, if you select one, all the others will be deselected!)

This is one of the times where frames come in handy. They allow you to seperate option button groups.

View attachment 2563The combo box! What is it? I think this screenshot can explain it :
View attachment 2577

How come you left this explanation out? Do you not understand what a combo box is? Or do you feel it is too advanced for this tutorial? (I'm trying to get a grasp on how advanced your skill with and knowledge of Visual Basic is.)

View attachment 2564The listbox! This is a component used for making lists, you can edit/read/add all /alues on the list, can be used for storage of information (Still, variables are safer xD)

Safer is not a word I'd use here. Perhaps you should go into detail as to the difference between variable storage and listbox storage...

View attachment 2565View attachment 2566 I personally never used these, they are for "scrolling" OR another use for them is adjustable progress bars (in the old days [windows 3.1 days that is] these were commonly used for adjustable progress bars in media players :) )

Scroll bars rock!

View attachment 2567Let's imagine you want something to occur every...let's say...500 milliseconds, it's by using this timer that you will get there!
there are 2 key proprieties in this component which are:
-Interval
-Enabled
in interval, you input the amount of milliseconds you want the timer to execute it's code and in Enabled is if it will keep looping the code or not.

Perhaps you should educate the user as to what a millisecond is. Your explanation for Enabled is sketchy.

View attachment 2568Drive list box, a very easy way to get a list of all drives on a computer! :D it works as a combo box, and as a list at the same time, but values cannot be altered! :O This component is "Read Only" if ya know what I mean xD

View attachment 2569Another great component, Dir List box, This can be used for old school file browsing/file "recon" :) and as the drive list box, it's read only

View attachment 2572File List Box, same as Drive List or DirList it's a list of files bla bla bla read only bla bla bla...

---VERY IMPORTANT!----

NOTE : YOU MUST INPUT WHICH DIRECTORY TO USE IN DIR/FILE LIST BOX!! AND THEN RUN ITS INTERNAL REFRESH FUNCTION!

---VERY IMPORTANT!----

View attachment 2573 You can make shapes on your App, good for decoration, you can make circles, squares, rectangles, etc..!

View attachment 2574 You can make lines too and change their position/look/direction in code, which may be useful!

View attachment 2571 Image, simply for imagery, supports strech too! (and gif (non animated), BMP, WMF, jpg)

View attachment 2575View attachment 2576 These two... I never used them xD OLE is for objects and the other one for databases :)


Now...WHAT ARE COMPONENTS!

Components are the various "objects" you can put on your program, be it an image, a label, a button, whatever! these are components!

Q: Are these the only ones I can use? :S there's not that many of them....

A: No, fortunately there are more, but there's a catch...For aditional components, you need the corresponding OCX file, if you put that program on a computer that doesn't have the required OCX files, the program WILL NOT RUN!
so be carefull using these!

Now, how to add them:


All you need to do is go to the menu bar and select "project" then components like so :

View attachment 2578

and this window should appear:
View attachment 2579

now just select what you want, press apply and tadaah!
View attachment 2580
new things!!! :O


Well then, that's all for today (Omg!! so many pics and text!!!)

Hope you liked it, be sure to post your questions, if any :)

Nice work. I should have noted this before though: include a subtitle when naming your tutorial so that we know what each tutorial will cover.

I realise I may be including corrections or comments that might be too advanced for this tutorial to cover, but I'm not just editing these tutorials for that purpose. I am editing them because I'd like you to learn from them too.

Ultimately, good tutorial though some things could have been better written and gone into further detail on.

You've also included some things that may be too advanced for a beginner programmer to use, but that's just my opinion.
 

Darkchild

The Doctor
No offense evilseph, but..seeing all those corrections (and don't take this the hard way) why don't you make your own tutorials?

Not only you'd save me a lotta work but the people would seem to understand you better
 

EvilSeph

Administrator
I've moved on from Visual Basic and seeing these tutorials brought back memories and was a nice refresher.

The main reason why I am correcting your guides is because guide writers obviously want to learn more about the subject they write about (and to teach something is the best way to learn something). By correcting your guides I am re-enforcing my knowledge on the subject, teaching you and anyone else who may read the guide and helping you (the guide writer) further improve their learning.

I apologise if I offended you in any way. I just felt like you wanted to learn and so I tried to make sure you were learning the best way possible and that what you were learning was correct.

Where did you learn how to program Visual Basic?
 
Top