SlideShare uma empresa Scribd logo
1 de 18
Baixar para ler offline
www.ThesisScientist.com
UNIT 1
INTRODUCTION TO VISUAL BASICS 6.0
The VB6 IDE (Integrated Development Environment) is a very simple and fully featured IDE. If
you start out programming in VB6 you may end up being too spoiled to ever appreciate a more
complicated and less functional IDE like most C++ IDEs. One feature which sets VB6 apart
from various IDEs is the simplicity of its approach to GUI (Graphical User Interface) design.
As a general rule: Play with it. You're very unlikely to break anything that matters, so just
explore and experiment with the IDE, and you'll learn more.
Creating A Project
1. Start VB6
2. When presented with a "New Project" dialog you will usually want to pick "Standard
EXE" and press "OK"
3. You now see the VB6 IDE, which contains an empty form called "Form1". That is your
program.
Description of the IDE
 In the middle of the program is a window which contains another window called
"Form1". This is called the GUI designer window. That window inside of there with the
title "Form1" is your program.
 On the left is the toolbox, which stores the pre-made objects you can place in your
program. This includes visual items you often see in programs like textboxes, command
buttons, checkboxes. It also has the potential to include invisible items like the winsock
control, which allows easy access to network communication.
 On the right is the Object properties pane, which contains all of the properties of the item
currently selected in the GUI designer.
 On the top there is the menu bar.
 On the top, below the menu bar is the toolbar.
Setting up the IDE
Don't allow sloppiness
1. Click on Tools->Options
2. Check "Require Variable Declaration"
3. Click on the "Environment" tab
4. Select the option button which says "Prompt to save changes"
www.ThesisScientist.com
5. Press "OK"
Get rid of silliness
On the bottom-right of the IDE, close the "Form Layout" pane because its pretty much useless.
Access to handy functions
1. Right-click somewhere on the toolbar and click on "Customize..."
2. Click on the "Commands" tab
3. Under "Categories", select "Edit"
4. Scroll down to about the middle of the "Commands" box until you can see "Indent",
"Outdent", "Comment Block", and "Uncomment Block". Drag all of those items to your
toolbar, putting them in order, right next to the "Start", "Pause", and "Stop" buttons.
5. Press "Close"
.
Changing Properties of Objects
If you click on an object on your form, or even the form itself, you gain access to the properties
of that item and change them in the properties pane on the right side of the screen.
Using controls
Placing controls on a form
All of the items on the left-hand of the screen, in the toolbox pane, are able to be added to a form
like this:
1. Click on the box representing the control you want in your program
2. Click the left mouse down on a space on a form, then drag to another spot and release the
left mouse button. This sometimes makes the control you selected the same size as you
directed, and sometimes objects are a fixed size which you can't modify
Importing extra controls
If you want to use a control which is not included in VB6's "Standard EXE" toolbox of 21
controls, you'll need to import them like this:
1. Right-click somewhere in the toolbox, and select "Components"
www.ThesisScientist.com
2. In that window you can select an OCX file which contains controls you can add to your
form
 If the control you're looking for isn't on the list then you can try to find it by clicking
"Browse..." and finding the OCX file manually
 Sometimes OCX files are given the extension DLL when the file is a DLL which
includes OCX data inside it
Underlined letters
When you press the Alt button in many programs you're shown little lines underneath certain
letters of menu items. If you then press on your keyboard a letter which corresponds to one of the
underlined letters then that menu item is selected.
In VB6, to get that functionality all you have to do is place an apersand (&) the letter before the
letter you want to be underlined and functional in this way.
This functionality exists in:
 Primary Menu items
 Secondary menu items
 Command buttons
 More..?
Running A Program
Take a look in the menu item "Run".
You will find that:
 Pressing "Start" in that menu, pressing the "Play" button, or pressing F5 on your
keyboard will run your program
 Pressing "Break" in that menu, pressing the "Pause" button, or pressing Ctrl+Break on
your keyboard will pause your program
o Allows you to edit your program while you're running it (AWESOME! Spoilage
factor here versus every other programming IDE)
 Pressing "End" in that menu, or pressing the "Stop" button will stop your program
Stopping A Program
When you are done testing your application, you will want to close it. There are several ways to
accomplish this.
www.ThesisScientist.com
 If at all possible you should close your application by pressing the "X" button on the top-
right of the window of an application, or using the keystroke Alt+F4. This is a "clean"
termination of the program.
The following options should be used only in the case that your program has stalled and you
cannot close it by pressing Alt+F4 or the "X" button on the program's window. In all of these
options there is a chance of causing a memory leak, which renders some space in your
computer's memory unusable until the next time you reboot the computer.
 If the VB6 IDE is still responsive: Press the "Stop" button located beside the "Play" and
"Pause" buttons in the VB6 IDE.
 If the VB6 IDE is no longer responsive: Press Ctrl+Break to Pause the program's
execution.
 If Ctrl+Break doesn't work: Try to end VB6.exe via the windows task manager.
 If none of that works: Time to restart the computer and go fix that horrible bug in your
program!
Compiling A Program
You must be using a full, retail copy of Visual BASIC. The Learning Edition will not compile to
EXE
 In the VB6 IDE, press File->Make ProjectName.exe, select a location and filename you
would like your program to have and VB6 will create that EXE for you simply and very
easily.
The process in which source code is converted into EXE is called "compiling", and is far more
simplified in VB6 than a language like C++.
In order for your program to run on any given computer, that computer must have all of your
program's "dependencies". All programs written in VB6 will require the Visual Basic 6 Runtime
Library (msvbvm6.dll). Happily: Windows XP had the VB6 runtime library ever since first
release, so if you make a VB6 program with no extra dependencies, it will work on Windows
XP.
Prior versions of windows, however, did not come with the VB6 runtime preloaded, and will
require it to be installed if it hasn't yet been installed.
If your program requires any extra DLL or OCX files in order to work, those are now
dependencies of your program which you will need to supply to anyone you want to send your
program to. For maximum portability it is a good idea to rely on functionality you implement in
www.ThesisScientist.com
your own program. If you're lucky, you can opt for implementing the CTL source code file from
an OCX into your program if the OCX is open-source and was written in VB6.
Getting into the source code
Right-click anywhere on the form called "Form1", and select "View code". Another way to
accomplish the same thing is to double-click anywhere on the form.
You should now see the following:
1. Option Explicit
2.
3. Private Sub Form_Load()
4. End Sub
This is the current source code behind this form. Your cursor is currently between "Private Sub
Form_Load()" and "End Sub" because the object you double-clicked on was a "Form" and the
default subroutine for the IDE to bring you to if there is nothing yet coded for that object is
"Load()".
You can change which subroutine associated with "Form" you want to look at by clicking
somewhere inside the "Form_Load" routine, then selecting one of the options inside the combo-
box on the top right of the window you're in.
This function will get you spoiled, quick.
Setting project properties
 In the top menu click on Project » Project1 Properties
Search through this dialog. Learn its options. Set the values inside.
This gives you a good understanding of the basics of the VB IDE. As you program and learn new
things these tips will prove very helpful. If you have any other tips or questions please post them
by clicking the Add Comment button below.
Beginner Tutorial - Hello World
Level:
Rank:
www.ThesisScientist.com
(11 votes)
Visual Basic is a great starter programming language. Not only is it easy to learn, but many
business applications use it extensively for their applications. If you are just starting to learn to
develop applications - this is a great language to start with. This tutorial and the many other
Visual Basic tutorials at this site will give you a solid foundation in your Visual Basic
knowledge.
Lets jump right in with a simple application. When you are done with this Visual Basic tutorial,
you should have a complete working application that when you click on the button it will say
"Hello, World"
Start Microsoft Visual Basic 6.0 (VB6)
The New Project dialog box will appear. If it doesn't go up to the menu bar and select File ->
New Project
www.ThesisScientist.com
In the New Project dialog select Standard EXE, and click the Open Button.
This will bring up your new Project 1 application with Form1 visible.
Already Visual Basic has done a lot for us. As you can see this tutorial isn't very long but already
you have a full working application. You can see your new program in action by going up to the
menu bar and selecting Run -> Start (Or simply press the F5 key).
You should see the Form1 window appear:
www.ThesisScientist.com
This is a fully functional application. You can move it around, minimize and maximize it, and
close it down. For you to do this same thing in C++ - the original language most of Windows
was written in you would have written hundreds of lines of code. You area already getting to see
some of the extreme power VB gives you. Now lets continue with the tutorial.
Lets make this program say hello!
www.ThesisScientist.com
On the left side of the screen you can see the toolbox (if this doesn't show up go to the top menu
bar and select View -> Toolbox). In this toolbox you will see a picture of a button. Double click
the button icon and it will create a Command1 CommandButton in the center of your form.
www.ThesisScientist.com
If you run the program now (Press F5) you will see your window now has a button labeled
Command1 in the center of it, but if you click the button it doesn't do anything. So lets wire
things up so our program will say "Hello, World" when you click the button. Close out of your
running program so you are back to the main design environment (pictured above)
Visual Basic allows you to do event driven programming. This is a concept that is very powerful
and easy to use. Event driven programming works as follows: Visual Basic has many different
events defined that occur when a specified thing happens. We as the programmer can link into
these events and write our custom code to do what we want. One very useful event is the Click
event. This event occurs any time the user clicks on the specified object. I'm sure the wheels are
already turning in your head, if we want to say hello world when someone clicks the button on
www.ThesisScientist.com
our form than we should do something in the Click event for the Command1 button. That is
exactly what we are going to do.
To write the click event code double click on the Command1 button. This will bring up the code
editor and will automatically write the beginning code to handle the click event.
Now any code you put between the Private Sub ... and the End Sub statements will be executed
when the user clicks the command button. To demonstrate this we will have a message box
appear saying hello world. So add this line of code:
1. Private Sub Command1_Click()
2. MsgBox "Hello, World!"
3. End Sub
www.ThesisScientist.com
MsgBox is a built in Visual Basic function that causes a message box to be displayed to the user.
The first parameter this function takes is the text string you wish to have displayed. We choose
the text string "Hello, World!". MsgBox also takes other parameters to specify things such as
what buttons to display and what caption to use, but these will be discussed later. For now lets
see how this works. Run your newly created Visual Basic hello world program (Press F5). Once
the program is running click the Command1 button, you should see a message box saying Hello,
World! appear.
Congragulations! You have written a complete working Visual Basic program using this Hello,
World tutorial. Read some of our other VB6 tutorials to learn how powerful this language really
is.
Object Types and Naming Scheme
This tutorial explains all the different aspects of Visual Basic data types and constructs. It also
gives suggestions as to how to name your different VB6 items. These are very important things
to remember in order to make your source code more easily intelligible.
File Types
You will use various file types while using VB6. These are some the most common ones.
 File type: What people call it
 Prefix: What people prefix the filename with
 Extension: What file extension is used
 Description: What its used for most often
File Type Prefix Extension Description
Project vbp General project options
Form frm frm GUI information and private code
BAS Module mod bas Project-wide accessible functions
Class Module cls cls Project-wide accessible subroutines
User Control uc ctl Control object (Like an OCX with source code)
Property page pag pag Property information
www.ThesisScientist.com
OLE Control ocx Compiled control object
Dynamic Link Lib dll Subs and functions accessible by other programs
Examples of common file names:
 OddCalc.vbp
 frmMain.frm
 frmAbout.frm
 frmPrintInvoice.frm
 modMain.bas
 modSettings.bas
 modDeclares.bas
 modWinsock.bas
 clsWinsock.cls
 ucCustomButton.ctl
 ucTreeView.ctl
 ucWinsock.ctl
Variables
A variable is a word or letter used to reference data used in a program. At the most basic level:
All variables used in a program (Even if its interpreted as text) are held on the computer as a
sequence of 1s and 0s (Binary) which represent numbers, which may or may not in turn represent
letters or any given ASCII character.
In a sane programmer's code the variable names are easy to understand because they clearly state
what the variable is used for inside of the variable name.
The information to be conveyed in a variable name is:
1. Variable data type
2. Functional use in program
This is accomplished by coming up with a unique word between about 3 and 10 letters which
explains the functional use of the variable as well as a prefix of usually 3 letters which explains
the variable data type.
A few examples of this:
 intResult -- An integer which is the result of an operation
 strFirstName -- A string which is used to store the first name of a person
www.ThesisScientist.com
 dtmWorkDayEnd -- A Date variable which is used to store the time of the end of the
work day
Computer Data Storage
All data stored on a computer is based upon binary values associated with them somewhere
between 0 and 255. This is the range of values possible with an 8 bit binary value (8 ones and
zeroes).
Decimal Binary Hexadecimal ASCII
48 0b00110000 0x30 0
49 0b00110001 0x31 1
50 0b00110010 0x32 2
------- --------------- --------- -----
55 0b00110111 0x37 7
56 0b00111000 0x38 8
57 0b00111001 0x39 9
------- --------------- --------- -----
65 0b01000001 0x41 A
66 0b01000010 0x42 B
67 0b01000011 0x43 C
------- --------------- --------- -----
88 0b01011000 0x58 X
89 0b01011001 0x59 Y
90 0b01011010 0x5A Z
------- --------------- --------- -----
97 0b01100001 0x61 a
98 0b01100010 0x62 b
99 0b01100011 0x63 c
www.ThesisScientist.com
------- --------------- --------- -----
120 0b01111000 0x78 x
121 0b01111001 0x79 y
122 0b01111010 0x7A z
A text character's "ASCII value" is the decimal value of the binary value used to represent that
character on the computer. In the case of the uppercase letters A, the ASCII value is 65, which is
01000001 in binary. Uppercase Z has an ASCII value of 90, which is 1011010 in binary. The
values for uppercase letters A through Z are between the values 65 and 90.
Anybody notice how similar the uppercase and lower case values are in binary and hex? In
binary you toggle the 32's place in order to change case, and in hex you add/subtract 2 from the
16's place. Handy.
Associated example to play with:
1. Option Explicit
2. Private Sub Form_Load()
3. Dim strChar As String ' Declares a variable
4.
5. ' Shows an input box and puts the result in a variable called strChar
6. strChar = InputBox("What would you like the ASCII value of?", "HUH!? PUNK!?",
"A")
7.
8. ' Shows a message box containing the ASCII value of the previously input letter
9. ' plus a random ASCII uppercase letter
10. MsgBox "The ASCII value of " & strChar & " is " & Asc(strChar) & vbNewLine & _
11. "And your random, uppercase ASCII character is: " & _
12. Chr$(RandomNumInRange(65, 90))
13. ' Unloads the form (Which cleanly ends the program if no other forms are loaded)
14. Unload Me
15. End Sub
16. Public Function RandomNumInRange(ByVal Low As Long, ByVal High As Long) As
Long
17. Randomize ' Randomizes Rnd() (Surprisingly good random number generator)
18.
19. ' Generates a random number between "High" and "Low" and returns it
20. RandomNumInRange = Int((High - Low + 1) * Rnd) + Low
21. End Function
www.ThesisScientist.com
Variable Names
The following are the requirements when naming the variables in Visual Basic:
 It must be less than 255 characters
 No spacing is allowed
 It must not begin with a number
 Period is not permitted
For the sake of making sure other people can look at your code and know what you were
thinking:
 Suffix your variable name with the appropriate suffix for your variable's data type
 Make sure the body of your variable name makes it easy to tell what its used for
 Don't use an ambiguous name like "intUhhhh" or "strX" unless its use is within a very
small scope of the program
Numeric Data Types
Type Size Range of Values Prefix
Example Variable
Name
Byte 1 byte 0 to 255 byt bytFirstChar
Integer
2
bytes
-32,768 to 32,767 int intCount
Long
4
bytes
-2,147,483,648 to 2,147,483,648 lng lngHwnd
Single
4
bytes
Negative values: -3.402823E+38 to -1.401298E-
45
Positive values: 1.401298E-45 to 3.402823E+38
sng sngPi
Double
8
bytes
Negative values: -1.79769313486232e+308 to -
4.94065645841247E-324
Positive values: 4.94065645841247E-324 to
1.79769313486232e+308
dbl dblAngle
Currency
8
bytes
-922,337,203,685,477.5808 to
922,337,203,685,477.5807
cur curTotalCost
www.ThesisScientist.com
Non-numeric Data Types
Type Size Range of Values Prefix
Example Variable
Name
String(fixed length)
Length of
string
1 to 65,400 characters str strName
String(variable
length)
Length + 10
bytes
0 to 2 billion characters str strHTML
Date 8 bytes
January 1, 100 to
December 31, 9999
dtm dtmBirth
Boolean 2 bytes True or False bln blnToggle
Object 4 bytes Any embedded object obj objCurrent
Variant(numeric) 16 bytes
Any value as large as
Double
vnt vntNumber
Variant(text)
Length+22
bytes
Same as variable-length
string
vnt vntName
Control Types
Control Type Prefix
TextBox txt
PictureBox pic
Label lbl
Frame fra
CommandButton cmd
CheckBox chk
RadioButton rad
ComboBox cbo
ListBox lst
Scroll Bar sbr (no orientation needed)
Timer tmr
DriveListBox drv
DirListBox dir
www.ThesisScientist.com
FileListBox fil
Shape shp
Image img
Data dat
OLE ole
ListView lvw
TreeView tvw
Examples of common object names:
 txtName
 txtAddress
 cboYear
 cmdOK
 cmdCancel
Hopefully this Visual Basic tutorial gave you good idea of all the different objects and data types
in VB6. By following these naming standards and using the appropriate types in your code you
will produce much better VB code.
Understanding variable

Mais conteúdo relacionado

Mais procurados

CIS 170 Exceptional Education - snaptutorial.com
CIS 170   Exceptional Education - snaptutorial.comCIS 170   Exceptional Education - snaptutorial.com
CIS 170 Exceptional Education - snaptutorial.comDavisMurphyB33
 
Cis407 a ilab 2 web application development devry university
Cis407 a ilab 2 web application development devry universityCis407 a ilab 2 web application development devry university
Cis407 a ilab 2 web application development devry universitylhkslkdh89009
 
Visual Basic IDE Introduction
Visual Basic IDE IntroductionVisual Basic IDE Introduction
Visual Basic IDE IntroductionAhllen Javier
 
Cis 170 Education Organization -- snaptutorial.com
Cis 170   Education Organization -- snaptutorial.comCis 170   Education Organization -- snaptutorial.com
Cis 170 Education Organization -- snaptutorial.comDavisMurphyB99
 
Cis 170 c Enhance teaching / snaptutorial.com
Cis 170 c  Enhance teaching / snaptutorial.comCis 170 c  Enhance teaching / snaptutorial.com
Cis 170 c Enhance teaching / snaptutorial.comHarrisGeorg51
 
CIS 170 Education Specialist / snaptutorial.com
CIS 170  Education Specialist / snaptutorial.comCIS 170  Education Specialist / snaptutorial.com
CIS 170 Education Specialist / snaptutorial.comMcdonaldRyan138
 
Flash Tutorial
Flash TutorialFlash Tutorial
Flash TutorialAdil Jafri
 
Introduction of VS2012 IDE and ASP.NET Controls
Introduction of VS2012 IDE and ASP.NET ControlsIntroduction of VS2012 IDE and ASP.NET Controls
Introduction of VS2012 IDE and ASP.NET ControlsKhademulBasher
 
Chapter 03 - Program Coding and Design
Chapter 03 - Program Coding and DesignChapter 03 - Program Coding and Design
Chapter 03 - Program Coding and Designpatf719
 
The ms visual basic 6
The ms visual basic 6The ms visual basic 6
The ms visual basic 6Eyelean xilef
 
Windows 7-getting-started
Windows 7-getting-startedWindows 7-getting-started
Windows 7-getting-startedjaimehero
 
Creating a text editor in delphi, a tutorial
Creating a text editor in delphi, a tutorialCreating a text editor in delphi, a tutorial
Creating a text editor in delphi, a tutorialErwin Frias Martinez
 
04 conexão logo! 0 ba7 com ihm
04 conexão logo! 0 ba7 com ihm04 conexão logo! 0 ba7 com ihm
04 conexão logo! 0 ba7 com ihmconfidencial
 
Visual basic ppt for tutorials computer
Visual basic ppt for tutorials computerVisual basic ppt for tutorials computer
Visual basic ppt for tutorials computersimran153
 

Mais procurados (19)

CIS 170 Exceptional Education - snaptutorial.com
CIS 170   Exceptional Education - snaptutorial.comCIS 170   Exceptional Education - snaptutorial.com
CIS 170 Exceptional Education - snaptutorial.com
 
Cis407 a ilab 2 web application development devry university
Cis407 a ilab 2 web application development devry universityCis407 a ilab 2 web application development devry university
Cis407 a ilab 2 web application development devry university
 
Chapter.09
Chapter.09Chapter.09
Chapter.09
 
Visual Basic IDE Introduction
Visual Basic IDE IntroductionVisual Basic IDE Introduction
Visual Basic IDE Introduction
 
Cis 170 Education Organization -- snaptutorial.com
Cis 170   Education Organization -- snaptutorial.comCis 170   Education Organization -- snaptutorial.com
Cis 170 Education Organization -- snaptutorial.com
 
Cis 170 c Enhance teaching / snaptutorial.com
Cis 170 c  Enhance teaching / snaptutorial.comCis 170 c  Enhance teaching / snaptutorial.com
Cis 170 c Enhance teaching / snaptutorial.com
 
Chapter.10
Chapter.10Chapter.10
Chapter.10
 
CIS 170 Education Specialist / snaptutorial.com
CIS 170  Education Specialist / snaptutorial.comCIS 170  Education Specialist / snaptutorial.com
CIS 170 Education Specialist / snaptutorial.com
 
Chapter.08
Chapter.08Chapter.08
Chapter.08
 
Flash Tutorial
Flash TutorialFlash Tutorial
Flash Tutorial
 
Introduction of VS2012 IDE and ASP.NET Controls
Introduction of VS2012 IDE and ASP.NET ControlsIntroduction of VS2012 IDE and ASP.NET Controls
Introduction of VS2012 IDE and ASP.NET Controls
 
Chapter 03 - Program Coding and Design
Chapter 03 - Program Coding and DesignChapter 03 - Program Coding and Design
Chapter 03 - Program Coding and Design
 
The ms visual basic 6
The ms visual basic 6The ms visual basic 6
The ms visual basic 6
 
Windows 7-getting-started
Windows 7-getting-startedWindows 7-getting-started
Windows 7-getting-started
 
Visual Basic Controls ppt
Visual Basic Controls pptVisual Basic Controls ppt
Visual Basic Controls ppt
 
Vb%20 tutorial
Vb%20 tutorialVb%20 tutorial
Vb%20 tutorial
 
Creating a text editor in delphi, a tutorial
Creating a text editor in delphi, a tutorialCreating a text editor in delphi, a tutorial
Creating a text editor in delphi, a tutorial
 
04 conexão logo! 0 ba7 com ihm
04 conexão logo! 0 ba7 com ihm04 conexão logo! 0 ba7 com ihm
04 conexão logo! 0 ba7 com ihm
 
Visual basic ppt for tutorials computer
Visual basic ppt for tutorials computerVisual basic ppt for tutorials computer
Visual basic ppt for tutorials computer
 

Semelhante a INTRODUCTION TO VISUAL BASICS

Visual studio ide componects dot net framwork
Visual studio ide componects dot net framworkVisual studio ide componects dot net framwork
Visual studio ide componects dot net framworkDipen Parmar
 
Visual basic concepts
Visual basic conceptsVisual basic concepts
Visual basic conceptsmelody77776
 
Membangun Desktop App
Membangun Desktop AppMembangun Desktop App
Membangun Desktop AppFajar Baskoro
 
hjksjdhksjhcksjhckjhskdjhcskjhckjdppt.pptx
hjksjdhksjhcksjhckjhskdjhcskjhckjdppt.pptxhjksjdhksjhcksjhckjhskdjhcskjhckjdppt.pptx
hjksjdhksjhcksjhckjhskdjhcskjhckjdppt.pptxEliasPetros
 
Lesson 4 Introduction to Human Computer Interaction.pptx
Lesson 4 Introduction to Human Computer Interaction.pptxLesson 4 Introduction to Human Computer Interaction.pptx
Lesson 4 Introduction to Human Computer Interaction.pptxEllenGracePorras
 
MS Office Professional 2010 Course.pdf
MS Office Professional 2010 Course.pdfMS Office Professional 2010 Course.pdf
MS Office Professional 2010 Course.pdfUdara Sandaruwan
 
Prg 218 entire course
Prg 218 entire coursePrg 218 entire course
Prg 218 entire coursegrades4u
 
Launching and Quiting microsoft word 2007
Launching and Quiting  microsoft  word 2007Launching and Quiting  microsoft  word 2007
Launching and Quiting microsoft word 2007Isaac Katete
 
Getting started with code composer studio v3.3 for tms320 f2812
Getting started with code composer studio v3.3 for tms320 f2812Getting started with code composer studio v3.3 for tms320 f2812
Getting started with code composer studio v3.3 for tms320 f2812Pantech ProLabs India Pvt Ltd
 
Taskbar & start menu properties
Taskbar & start menu propertiesTaskbar & start menu properties
Taskbar & start menu propertiesSabiry
 
Chapter.01
Chapter.01Chapter.01
Chapter.01klivsie
 
window_10_user_guide.pdf
window_10_user_guide.pdfwindow_10_user_guide.pdf
window_10_user_guide.pdfMertin2
 
Windowstechnicalpreviewqg
WindowstechnicalpreviewqgWindowstechnicalpreviewqg
WindowstechnicalpreviewqgAlex Carranza
 
Windows 10 Technical Preview - http://f2suporte.blogspot.com
Windows 10 Technical Preview - http://f2suporte.blogspot.comWindows 10 Technical Preview - http://f2suporte.blogspot.com
Windows 10 Technical Preview - http://f2suporte.blogspot.comWlademir RS
 
How to work with code blocks
How to work with code blocksHow to work with code blocks
How to work with code blocksTech Bikram
 

Semelhante a INTRODUCTION TO VISUAL BASICS (20)

Visual studio ide componects dot net framwork
Visual studio ide componects dot net framworkVisual studio ide componects dot net framwork
Visual studio ide componects dot net framwork
 
Vb.net ide
Vb.net ideVb.net ide
Vb.net ide
 
Visual basic concepts
Visual basic conceptsVisual basic concepts
Visual basic concepts
 
Membangun Desktop App
Membangun Desktop AppMembangun Desktop App
Membangun Desktop App
 
hjksjdhksjhcksjhckjhskdjhcskjhckjdppt.pptx
hjksjdhksjhcksjhckjhskdjhcskjhckjdppt.pptxhjksjdhksjhcksjhckjhskdjhcskjhckjdppt.pptx
hjksjdhksjhcksjhckjhskdjhcskjhckjdppt.pptx
 
Lesson 4 Introduction to Human Computer Interaction.pptx
Lesson 4 Introduction to Human Computer Interaction.pptxLesson 4 Introduction to Human Computer Interaction.pptx
Lesson 4 Introduction to Human Computer Interaction.pptx
 
MS Office Professional 2010 Course.pdf
MS Office Professional 2010 Course.pdfMS Office Professional 2010 Course.pdf
MS Office Professional 2010 Course.pdf
 
L5 kongl
L5 konglL5 kongl
L5 kongl
 
Prg 218 entire course
Prg 218 entire coursePrg 218 entire course
Prg 218 entire course
 
Visual basic
Visual basicVisual basic
Visual basic
 
Launching and Quiting microsoft word 2007
Launching and Quiting  microsoft  word 2007Launching and Quiting  microsoft  word 2007
Launching and Quiting microsoft word 2007
 
Getting started with code composer studio v3.3 for tms320 f2812
Getting started with code composer studio v3.3 for tms320 f2812Getting started with code composer studio v3.3 for tms320 f2812
Getting started with code composer studio v3.3 for tms320 f2812
 
UNIT I.pptx
UNIT I.pptxUNIT I.pptx
UNIT I.pptx
 
Taskbar & start menu properties
Taskbar & start menu propertiesTaskbar & start menu properties
Taskbar & start menu properties
 
Chapter.01
Chapter.01Chapter.01
Chapter.01
 
Chapter.01
Chapter.01Chapter.01
Chapter.01
 
window_10_user_guide.pdf
window_10_user_guide.pdfwindow_10_user_guide.pdf
window_10_user_guide.pdf
 
Windowstechnicalpreviewqg
WindowstechnicalpreviewqgWindowstechnicalpreviewqg
Windowstechnicalpreviewqg
 
Windows 10 Technical Preview - http://f2suporte.blogspot.com
Windows 10 Technical Preview - http://f2suporte.blogspot.comWindows 10 Technical Preview - http://f2suporte.blogspot.com
Windows 10 Technical Preview - http://f2suporte.blogspot.com
 
How to work with code blocks
How to work with code blocksHow to work with code blocks
How to work with code blocks
 

Mais de Prof Ansari

Sci Hub New Domain
Sci Hub New DomainSci Hub New Domain
Sci Hub New DomainProf Ansari
 
Sci Hub cc Not Working
Sci Hub cc Not WorkingSci Hub cc Not Working
Sci Hub cc Not WorkingProf Ansari
 
basics of computer network
basics of computer networkbasics of computer network
basics of computer networkProf Ansari
 
JAVA INTRODUCTION
JAVA INTRODUCTIONJAVA INTRODUCTION
JAVA INTRODUCTIONProf Ansari
 
Project Evaluation and Estimation in Software Development
Project Evaluation and Estimation in Software DevelopmentProject Evaluation and Estimation in Software Development
Project Evaluation and Estimation in Software DevelopmentProf Ansari
 
Stepwise Project planning in software development
Stepwise Project planning in software developmentStepwise Project planning in software development
Stepwise Project planning in software developmentProf Ansari
 
Database and Math Relations
Database and Math RelationsDatabase and Math Relations
Database and Math RelationsProf Ansari
 
Normalisation in Database management System (DBMS)
Normalisation in Database management System (DBMS)Normalisation in Database management System (DBMS)
Normalisation in Database management System (DBMS)Prof Ansari
 
Entity-Relationship Data Model in DBMS
Entity-Relationship Data Model in DBMSEntity-Relationship Data Model in DBMS
Entity-Relationship Data Model in DBMSProf Ansari
 
A Detail Database Architecture
A Detail Database ArchitectureA Detail Database Architecture
A Detail Database ArchitectureProf Ansari
 
INTRODUCTION TO Database Management System (DBMS)
INTRODUCTION TO Database Management System (DBMS)INTRODUCTION TO Database Management System (DBMS)
INTRODUCTION TO Database Management System (DBMS)Prof Ansari
 
Master thesis on Vehicular Ad hoc Networks (VANET)
Master thesis on Vehicular Ad hoc Networks (VANET)Master thesis on Vehicular Ad hoc Networks (VANET)
Master thesis on Vehicular Ad hoc Networks (VANET)Prof Ansari
 
Master Thesis on Vehicular Ad-hoc Network (VANET)
Master Thesis on Vehicular Ad-hoc Network (VANET)Master Thesis on Vehicular Ad-hoc Network (VANET)
Master Thesis on Vehicular Ad-hoc Network (VANET)Prof Ansari
 
INTERFACING WITH INTEL 8251A (USART)
INTERFACING WITH INTEL 8251A (USART)INTERFACING WITH INTEL 8251A (USART)
INTERFACING WITH INTEL 8251A (USART)Prof Ansari
 
HOST AND NETWORK SECURITY by ThesisScientist.com
HOST AND NETWORK SECURITY by ThesisScientist.comHOST AND NETWORK SECURITY by ThesisScientist.com
HOST AND NETWORK SECURITY by ThesisScientist.comProf Ansari
 
SYSTEM NETWORK ADMINISTRATIONS GOALS and TIPS
SYSTEM NETWORK ADMINISTRATIONS GOALS and TIPSSYSTEM NETWORK ADMINISTRATIONS GOALS and TIPS
SYSTEM NETWORK ADMINISTRATIONS GOALS and TIPSProf Ansari
 
introduction to Blogging ppt
introduction to Blogging pptintroduction to Blogging ppt
introduction to Blogging pptProf Ansari
 
INTRODUCTION TO SOFTWARE ENGINEERING
INTRODUCTION TO SOFTWARE ENGINEERINGINTRODUCTION TO SOFTWARE ENGINEERING
INTRODUCTION TO SOFTWARE ENGINEERINGProf Ansari
 
Introduction to E-commerce
Introduction to E-commerceIntroduction to E-commerce
Introduction to E-commerceProf Ansari
 
Sorting and Searching Techniques
Sorting and Searching TechniquesSorting and Searching Techniques
Sorting and Searching TechniquesProf Ansari
 

Mais de Prof Ansari (20)

Sci Hub New Domain
Sci Hub New DomainSci Hub New Domain
Sci Hub New Domain
 
Sci Hub cc Not Working
Sci Hub cc Not WorkingSci Hub cc Not Working
Sci Hub cc Not Working
 
basics of computer network
basics of computer networkbasics of computer network
basics of computer network
 
JAVA INTRODUCTION
JAVA INTRODUCTIONJAVA INTRODUCTION
JAVA INTRODUCTION
 
Project Evaluation and Estimation in Software Development
Project Evaluation and Estimation in Software DevelopmentProject Evaluation and Estimation in Software Development
Project Evaluation and Estimation in Software Development
 
Stepwise Project planning in software development
Stepwise Project planning in software developmentStepwise Project planning in software development
Stepwise Project planning in software development
 
Database and Math Relations
Database and Math RelationsDatabase and Math Relations
Database and Math Relations
 
Normalisation in Database management System (DBMS)
Normalisation in Database management System (DBMS)Normalisation in Database management System (DBMS)
Normalisation in Database management System (DBMS)
 
Entity-Relationship Data Model in DBMS
Entity-Relationship Data Model in DBMSEntity-Relationship Data Model in DBMS
Entity-Relationship Data Model in DBMS
 
A Detail Database Architecture
A Detail Database ArchitectureA Detail Database Architecture
A Detail Database Architecture
 
INTRODUCTION TO Database Management System (DBMS)
INTRODUCTION TO Database Management System (DBMS)INTRODUCTION TO Database Management System (DBMS)
INTRODUCTION TO Database Management System (DBMS)
 
Master thesis on Vehicular Ad hoc Networks (VANET)
Master thesis on Vehicular Ad hoc Networks (VANET)Master thesis on Vehicular Ad hoc Networks (VANET)
Master thesis on Vehicular Ad hoc Networks (VANET)
 
Master Thesis on Vehicular Ad-hoc Network (VANET)
Master Thesis on Vehicular Ad-hoc Network (VANET)Master Thesis on Vehicular Ad-hoc Network (VANET)
Master Thesis on Vehicular Ad-hoc Network (VANET)
 
INTERFACING WITH INTEL 8251A (USART)
INTERFACING WITH INTEL 8251A (USART)INTERFACING WITH INTEL 8251A (USART)
INTERFACING WITH INTEL 8251A (USART)
 
HOST AND NETWORK SECURITY by ThesisScientist.com
HOST AND NETWORK SECURITY by ThesisScientist.comHOST AND NETWORK SECURITY by ThesisScientist.com
HOST AND NETWORK SECURITY by ThesisScientist.com
 
SYSTEM NETWORK ADMINISTRATIONS GOALS and TIPS
SYSTEM NETWORK ADMINISTRATIONS GOALS and TIPSSYSTEM NETWORK ADMINISTRATIONS GOALS and TIPS
SYSTEM NETWORK ADMINISTRATIONS GOALS and TIPS
 
introduction to Blogging ppt
introduction to Blogging pptintroduction to Blogging ppt
introduction to Blogging ppt
 
INTRODUCTION TO SOFTWARE ENGINEERING
INTRODUCTION TO SOFTWARE ENGINEERINGINTRODUCTION TO SOFTWARE ENGINEERING
INTRODUCTION TO SOFTWARE ENGINEERING
 
Introduction to E-commerce
Introduction to E-commerceIntroduction to E-commerce
Introduction to E-commerce
 
Sorting and Searching Techniques
Sorting and Searching TechniquesSorting and Searching Techniques
Sorting and Searching Techniques
 

Último

Russian Call Girls in Nagpur Grishma Call 7001035870 Meet With Nagpur Escorts
Russian Call Girls in Nagpur Grishma Call 7001035870 Meet With Nagpur EscortsRussian Call Girls in Nagpur Grishma Call 7001035870 Meet With Nagpur Escorts
Russian Call Girls in Nagpur Grishma Call 7001035870 Meet With Nagpur EscortsCall Girls in Nagpur High Profile
 
Porous Ceramics seminar and technical writing
Porous Ceramics seminar and technical writingPorous Ceramics seminar and technical writing
Porous Ceramics seminar and technical writingrakeshbaidya232001
 
Introduction to Multiple Access Protocol.pptx
Introduction to Multiple Access Protocol.pptxIntroduction to Multiple Access Protocol.pptx
Introduction to Multiple Access Protocol.pptxupamatechverse
 
KubeKraft presentation @CloudNativeHooghly
KubeKraft presentation @CloudNativeHooghlyKubeKraft presentation @CloudNativeHooghly
KubeKraft presentation @CloudNativeHooghlysanyuktamishra911
 
Call Girls Pimpri Chinchwad Call Me 7737669865 Budget Friendly No Advance Boo...
Call Girls Pimpri Chinchwad Call Me 7737669865 Budget Friendly No Advance Boo...Call Girls Pimpri Chinchwad Call Me 7737669865 Budget Friendly No Advance Boo...
Call Girls Pimpri Chinchwad Call Me 7737669865 Budget Friendly No Advance Boo...roncy bisnoi
 
Online banking management system project.pdf
Online banking management system project.pdfOnline banking management system project.pdf
Online banking management system project.pdfKamal Acharya
 
Call Girls Service Nagpur Tanvi Call 7001035870 Meet With Nagpur Escorts
Call Girls Service Nagpur Tanvi Call 7001035870 Meet With Nagpur EscortsCall Girls Service Nagpur Tanvi Call 7001035870 Meet With Nagpur Escorts
Call Girls Service Nagpur Tanvi Call 7001035870 Meet With Nagpur EscortsCall Girls in Nagpur High Profile
 
UNIT - IV - Air Compressors and its Performance
UNIT - IV - Air Compressors and its PerformanceUNIT - IV - Air Compressors and its Performance
UNIT - IV - Air Compressors and its Performancesivaprakash250
 
(ANJALI) Dange Chowk Call Girls Just Call 7001035870 [ Cash on Delivery ] Pun...
(ANJALI) Dange Chowk Call Girls Just Call 7001035870 [ Cash on Delivery ] Pun...(ANJALI) Dange Chowk Call Girls Just Call 7001035870 [ Cash on Delivery ] Pun...
(ANJALI) Dange Chowk Call Girls Just Call 7001035870 [ Cash on Delivery ] Pun...ranjana rawat
 
Coefficient of Thermal Expansion and their Importance.pptx
Coefficient of Thermal Expansion and their Importance.pptxCoefficient of Thermal Expansion and their Importance.pptx
Coefficient of Thermal Expansion and their Importance.pptxAsutosh Ranjan
 
Java Programming :Event Handling(Types of Events)
Java Programming :Event Handling(Types of Events)Java Programming :Event Handling(Types of Events)
Java Programming :Event Handling(Types of Events)simmis5
 
AKTU Computer Networks notes --- Unit 3.pdf
AKTU Computer Networks notes ---  Unit 3.pdfAKTU Computer Networks notes ---  Unit 3.pdf
AKTU Computer Networks notes --- Unit 3.pdfankushspencer015
 
Call Girls in Nagpur Suman Call 7001035870 Meet With Nagpur Escorts
Call Girls in Nagpur Suman Call 7001035870 Meet With Nagpur EscortsCall Girls in Nagpur Suman Call 7001035870 Meet With Nagpur Escorts
Call Girls in Nagpur Suman Call 7001035870 Meet With Nagpur EscortsCall Girls in Nagpur High Profile
 
Introduction and different types of Ethernet.pptx
Introduction and different types of Ethernet.pptxIntroduction and different types of Ethernet.pptx
Introduction and different types of Ethernet.pptxupamatechverse
 
The Most Attractive Pune Call Girls Budhwar Peth 8250192130 Will You Miss Thi...
The Most Attractive Pune Call Girls Budhwar Peth 8250192130 Will You Miss Thi...The Most Attractive Pune Call Girls Budhwar Peth 8250192130 Will You Miss Thi...
The Most Attractive Pune Call Girls Budhwar Peth 8250192130 Will You Miss Thi...ranjana rawat
 
UNIT-V FMM.HYDRAULIC TURBINE - Construction and working
UNIT-V FMM.HYDRAULIC TURBINE - Construction and workingUNIT-V FMM.HYDRAULIC TURBINE - Construction and working
UNIT-V FMM.HYDRAULIC TURBINE - Construction and workingrknatarajan
 
Top Rated Pune Call Girls Budhwar Peth ⟟ 6297143586 ⟟ Call Me For Genuine Se...
Top Rated  Pune Call Girls Budhwar Peth ⟟ 6297143586 ⟟ Call Me For Genuine Se...Top Rated  Pune Call Girls Budhwar Peth ⟟ 6297143586 ⟟ Call Me For Genuine Se...
Top Rated Pune Call Girls Budhwar Peth ⟟ 6297143586 ⟟ Call Me For Genuine Se...Call Girls in Nagpur High Profile
 
MANUFACTURING PROCESS-II UNIT-1 THEORY OF METAL CUTTING
MANUFACTURING PROCESS-II UNIT-1 THEORY OF METAL CUTTINGMANUFACTURING PROCESS-II UNIT-1 THEORY OF METAL CUTTING
MANUFACTURING PROCESS-II UNIT-1 THEORY OF METAL CUTTINGSIVASHANKAR N
 

Último (20)

Russian Call Girls in Nagpur Grishma Call 7001035870 Meet With Nagpur Escorts
Russian Call Girls in Nagpur Grishma Call 7001035870 Meet With Nagpur EscortsRussian Call Girls in Nagpur Grishma Call 7001035870 Meet With Nagpur Escorts
Russian Call Girls in Nagpur Grishma Call 7001035870 Meet With Nagpur Escorts
 
Porous Ceramics seminar and technical writing
Porous Ceramics seminar and technical writingPorous Ceramics seminar and technical writing
Porous Ceramics seminar and technical writing
 
Roadmap to Membership of RICS - Pathways and Routes
Roadmap to Membership of RICS - Pathways and RoutesRoadmap to Membership of RICS - Pathways and Routes
Roadmap to Membership of RICS - Pathways and Routes
 
Introduction to Multiple Access Protocol.pptx
Introduction to Multiple Access Protocol.pptxIntroduction to Multiple Access Protocol.pptx
Introduction to Multiple Access Protocol.pptx
 
KubeKraft presentation @CloudNativeHooghly
KubeKraft presentation @CloudNativeHooghlyKubeKraft presentation @CloudNativeHooghly
KubeKraft presentation @CloudNativeHooghly
 
Call Girls Pimpri Chinchwad Call Me 7737669865 Budget Friendly No Advance Boo...
Call Girls Pimpri Chinchwad Call Me 7737669865 Budget Friendly No Advance Boo...Call Girls Pimpri Chinchwad Call Me 7737669865 Budget Friendly No Advance Boo...
Call Girls Pimpri Chinchwad Call Me 7737669865 Budget Friendly No Advance Boo...
 
Online banking management system project.pdf
Online banking management system project.pdfOnline banking management system project.pdf
Online banking management system project.pdf
 
Call Girls Service Nagpur Tanvi Call 7001035870 Meet With Nagpur Escorts
Call Girls Service Nagpur Tanvi Call 7001035870 Meet With Nagpur EscortsCall Girls Service Nagpur Tanvi Call 7001035870 Meet With Nagpur Escorts
Call Girls Service Nagpur Tanvi Call 7001035870 Meet With Nagpur Escorts
 
UNIT - IV - Air Compressors and its Performance
UNIT - IV - Air Compressors and its PerformanceUNIT - IV - Air Compressors and its Performance
UNIT - IV - Air Compressors and its Performance
 
(ANJALI) Dange Chowk Call Girls Just Call 7001035870 [ Cash on Delivery ] Pun...
(ANJALI) Dange Chowk Call Girls Just Call 7001035870 [ Cash on Delivery ] Pun...(ANJALI) Dange Chowk Call Girls Just Call 7001035870 [ Cash on Delivery ] Pun...
(ANJALI) Dange Chowk Call Girls Just Call 7001035870 [ Cash on Delivery ] Pun...
 
Coefficient of Thermal Expansion and their Importance.pptx
Coefficient of Thermal Expansion and their Importance.pptxCoefficient of Thermal Expansion and their Importance.pptx
Coefficient of Thermal Expansion and their Importance.pptx
 
Java Programming :Event Handling(Types of Events)
Java Programming :Event Handling(Types of Events)Java Programming :Event Handling(Types of Events)
Java Programming :Event Handling(Types of Events)
 
AKTU Computer Networks notes --- Unit 3.pdf
AKTU Computer Networks notes ---  Unit 3.pdfAKTU Computer Networks notes ---  Unit 3.pdf
AKTU Computer Networks notes --- Unit 3.pdf
 
DJARUM4D - SLOT GACOR ONLINE | SLOT DEMO ONLINE
DJARUM4D - SLOT GACOR ONLINE | SLOT DEMO ONLINEDJARUM4D - SLOT GACOR ONLINE | SLOT DEMO ONLINE
DJARUM4D - SLOT GACOR ONLINE | SLOT DEMO ONLINE
 
Call Girls in Nagpur Suman Call 7001035870 Meet With Nagpur Escorts
Call Girls in Nagpur Suman Call 7001035870 Meet With Nagpur EscortsCall Girls in Nagpur Suman Call 7001035870 Meet With Nagpur Escorts
Call Girls in Nagpur Suman Call 7001035870 Meet With Nagpur Escorts
 
Introduction and different types of Ethernet.pptx
Introduction and different types of Ethernet.pptxIntroduction and different types of Ethernet.pptx
Introduction and different types of Ethernet.pptx
 
The Most Attractive Pune Call Girls Budhwar Peth 8250192130 Will You Miss Thi...
The Most Attractive Pune Call Girls Budhwar Peth 8250192130 Will You Miss Thi...The Most Attractive Pune Call Girls Budhwar Peth 8250192130 Will You Miss Thi...
The Most Attractive Pune Call Girls Budhwar Peth 8250192130 Will You Miss Thi...
 
UNIT-V FMM.HYDRAULIC TURBINE - Construction and working
UNIT-V FMM.HYDRAULIC TURBINE - Construction and workingUNIT-V FMM.HYDRAULIC TURBINE - Construction and working
UNIT-V FMM.HYDRAULIC TURBINE - Construction and working
 
Top Rated Pune Call Girls Budhwar Peth ⟟ 6297143586 ⟟ Call Me For Genuine Se...
Top Rated  Pune Call Girls Budhwar Peth ⟟ 6297143586 ⟟ Call Me For Genuine Se...Top Rated  Pune Call Girls Budhwar Peth ⟟ 6297143586 ⟟ Call Me For Genuine Se...
Top Rated Pune Call Girls Budhwar Peth ⟟ 6297143586 ⟟ Call Me For Genuine Se...
 
MANUFACTURING PROCESS-II UNIT-1 THEORY OF METAL CUTTING
MANUFACTURING PROCESS-II UNIT-1 THEORY OF METAL CUTTINGMANUFACTURING PROCESS-II UNIT-1 THEORY OF METAL CUTTING
MANUFACTURING PROCESS-II UNIT-1 THEORY OF METAL CUTTING
 

INTRODUCTION TO VISUAL BASICS

  • 1. www.ThesisScientist.com UNIT 1 INTRODUCTION TO VISUAL BASICS 6.0 The VB6 IDE (Integrated Development Environment) is a very simple and fully featured IDE. If you start out programming in VB6 you may end up being too spoiled to ever appreciate a more complicated and less functional IDE like most C++ IDEs. One feature which sets VB6 apart from various IDEs is the simplicity of its approach to GUI (Graphical User Interface) design. As a general rule: Play with it. You're very unlikely to break anything that matters, so just explore and experiment with the IDE, and you'll learn more. Creating A Project 1. Start VB6 2. When presented with a "New Project" dialog you will usually want to pick "Standard EXE" and press "OK" 3. You now see the VB6 IDE, which contains an empty form called "Form1". That is your program. Description of the IDE  In the middle of the program is a window which contains another window called "Form1". This is called the GUI designer window. That window inside of there with the title "Form1" is your program.  On the left is the toolbox, which stores the pre-made objects you can place in your program. This includes visual items you often see in programs like textboxes, command buttons, checkboxes. It also has the potential to include invisible items like the winsock control, which allows easy access to network communication.  On the right is the Object properties pane, which contains all of the properties of the item currently selected in the GUI designer.  On the top there is the menu bar.  On the top, below the menu bar is the toolbar. Setting up the IDE Don't allow sloppiness 1. Click on Tools->Options 2. Check "Require Variable Declaration" 3. Click on the "Environment" tab 4. Select the option button which says "Prompt to save changes"
  • 2. www.ThesisScientist.com 5. Press "OK" Get rid of silliness On the bottom-right of the IDE, close the "Form Layout" pane because its pretty much useless. Access to handy functions 1. Right-click somewhere on the toolbar and click on "Customize..." 2. Click on the "Commands" tab 3. Under "Categories", select "Edit" 4. Scroll down to about the middle of the "Commands" box until you can see "Indent", "Outdent", "Comment Block", and "Uncomment Block". Drag all of those items to your toolbar, putting them in order, right next to the "Start", "Pause", and "Stop" buttons. 5. Press "Close" . Changing Properties of Objects If you click on an object on your form, or even the form itself, you gain access to the properties of that item and change them in the properties pane on the right side of the screen. Using controls Placing controls on a form All of the items on the left-hand of the screen, in the toolbox pane, are able to be added to a form like this: 1. Click on the box representing the control you want in your program 2. Click the left mouse down on a space on a form, then drag to another spot and release the left mouse button. This sometimes makes the control you selected the same size as you directed, and sometimes objects are a fixed size which you can't modify Importing extra controls If you want to use a control which is not included in VB6's "Standard EXE" toolbox of 21 controls, you'll need to import them like this: 1. Right-click somewhere in the toolbox, and select "Components"
  • 3. www.ThesisScientist.com 2. In that window you can select an OCX file which contains controls you can add to your form  If the control you're looking for isn't on the list then you can try to find it by clicking "Browse..." and finding the OCX file manually  Sometimes OCX files are given the extension DLL when the file is a DLL which includes OCX data inside it Underlined letters When you press the Alt button in many programs you're shown little lines underneath certain letters of menu items. If you then press on your keyboard a letter which corresponds to one of the underlined letters then that menu item is selected. In VB6, to get that functionality all you have to do is place an apersand (&) the letter before the letter you want to be underlined and functional in this way. This functionality exists in:  Primary Menu items  Secondary menu items  Command buttons  More..? Running A Program Take a look in the menu item "Run". You will find that:  Pressing "Start" in that menu, pressing the "Play" button, or pressing F5 on your keyboard will run your program  Pressing "Break" in that menu, pressing the "Pause" button, or pressing Ctrl+Break on your keyboard will pause your program o Allows you to edit your program while you're running it (AWESOME! Spoilage factor here versus every other programming IDE)  Pressing "End" in that menu, or pressing the "Stop" button will stop your program Stopping A Program When you are done testing your application, you will want to close it. There are several ways to accomplish this.
  • 4. www.ThesisScientist.com  If at all possible you should close your application by pressing the "X" button on the top- right of the window of an application, or using the keystroke Alt+F4. This is a "clean" termination of the program. The following options should be used only in the case that your program has stalled and you cannot close it by pressing Alt+F4 or the "X" button on the program's window. In all of these options there is a chance of causing a memory leak, which renders some space in your computer's memory unusable until the next time you reboot the computer.  If the VB6 IDE is still responsive: Press the "Stop" button located beside the "Play" and "Pause" buttons in the VB6 IDE.  If the VB6 IDE is no longer responsive: Press Ctrl+Break to Pause the program's execution.  If Ctrl+Break doesn't work: Try to end VB6.exe via the windows task manager.  If none of that works: Time to restart the computer and go fix that horrible bug in your program! Compiling A Program You must be using a full, retail copy of Visual BASIC. The Learning Edition will not compile to EXE  In the VB6 IDE, press File->Make ProjectName.exe, select a location and filename you would like your program to have and VB6 will create that EXE for you simply and very easily. The process in which source code is converted into EXE is called "compiling", and is far more simplified in VB6 than a language like C++. In order for your program to run on any given computer, that computer must have all of your program's "dependencies". All programs written in VB6 will require the Visual Basic 6 Runtime Library (msvbvm6.dll). Happily: Windows XP had the VB6 runtime library ever since first release, so if you make a VB6 program with no extra dependencies, it will work on Windows XP. Prior versions of windows, however, did not come with the VB6 runtime preloaded, and will require it to be installed if it hasn't yet been installed. If your program requires any extra DLL or OCX files in order to work, those are now dependencies of your program which you will need to supply to anyone you want to send your program to. For maximum portability it is a good idea to rely on functionality you implement in
  • 5. www.ThesisScientist.com your own program. If you're lucky, you can opt for implementing the CTL source code file from an OCX into your program if the OCX is open-source and was written in VB6. Getting into the source code Right-click anywhere on the form called "Form1", and select "View code". Another way to accomplish the same thing is to double-click anywhere on the form. You should now see the following: 1. Option Explicit 2. 3. Private Sub Form_Load() 4. End Sub This is the current source code behind this form. Your cursor is currently between "Private Sub Form_Load()" and "End Sub" because the object you double-clicked on was a "Form" and the default subroutine for the IDE to bring you to if there is nothing yet coded for that object is "Load()". You can change which subroutine associated with "Form" you want to look at by clicking somewhere inside the "Form_Load" routine, then selecting one of the options inside the combo- box on the top right of the window you're in. This function will get you spoiled, quick. Setting project properties  In the top menu click on Project » Project1 Properties Search through this dialog. Learn its options. Set the values inside. This gives you a good understanding of the basics of the VB IDE. As you program and learn new things these tips will prove very helpful. If you have any other tips or questions please post them by clicking the Add Comment button below. Beginner Tutorial - Hello World Level: Rank:
  • 6. www.ThesisScientist.com (11 votes) Visual Basic is a great starter programming language. Not only is it easy to learn, but many business applications use it extensively for their applications. If you are just starting to learn to develop applications - this is a great language to start with. This tutorial and the many other Visual Basic tutorials at this site will give you a solid foundation in your Visual Basic knowledge. Lets jump right in with a simple application. When you are done with this Visual Basic tutorial, you should have a complete working application that when you click on the button it will say "Hello, World" Start Microsoft Visual Basic 6.0 (VB6) The New Project dialog box will appear. If it doesn't go up to the menu bar and select File -> New Project
  • 7. www.ThesisScientist.com In the New Project dialog select Standard EXE, and click the Open Button. This will bring up your new Project 1 application with Form1 visible. Already Visual Basic has done a lot for us. As you can see this tutorial isn't very long but already you have a full working application. You can see your new program in action by going up to the menu bar and selecting Run -> Start (Or simply press the F5 key). You should see the Form1 window appear:
  • 8. www.ThesisScientist.com This is a fully functional application. You can move it around, minimize and maximize it, and close it down. For you to do this same thing in C++ - the original language most of Windows was written in you would have written hundreds of lines of code. You area already getting to see some of the extreme power VB gives you. Now lets continue with the tutorial. Lets make this program say hello!
  • 9. www.ThesisScientist.com On the left side of the screen you can see the toolbox (if this doesn't show up go to the top menu bar and select View -> Toolbox). In this toolbox you will see a picture of a button. Double click the button icon and it will create a Command1 CommandButton in the center of your form.
  • 10. www.ThesisScientist.com If you run the program now (Press F5) you will see your window now has a button labeled Command1 in the center of it, but if you click the button it doesn't do anything. So lets wire things up so our program will say "Hello, World" when you click the button. Close out of your running program so you are back to the main design environment (pictured above) Visual Basic allows you to do event driven programming. This is a concept that is very powerful and easy to use. Event driven programming works as follows: Visual Basic has many different events defined that occur when a specified thing happens. We as the programmer can link into these events and write our custom code to do what we want. One very useful event is the Click event. This event occurs any time the user clicks on the specified object. I'm sure the wheels are already turning in your head, if we want to say hello world when someone clicks the button on
  • 11. www.ThesisScientist.com our form than we should do something in the Click event for the Command1 button. That is exactly what we are going to do. To write the click event code double click on the Command1 button. This will bring up the code editor and will automatically write the beginning code to handle the click event. Now any code you put between the Private Sub ... and the End Sub statements will be executed when the user clicks the command button. To demonstrate this we will have a message box appear saying hello world. So add this line of code: 1. Private Sub Command1_Click() 2. MsgBox "Hello, World!" 3. End Sub
  • 12. www.ThesisScientist.com MsgBox is a built in Visual Basic function that causes a message box to be displayed to the user. The first parameter this function takes is the text string you wish to have displayed. We choose the text string "Hello, World!". MsgBox also takes other parameters to specify things such as what buttons to display and what caption to use, but these will be discussed later. For now lets see how this works. Run your newly created Visual Basic hello world program (Press F5). Once the program is running click the Command1 button, you should see a message box saying Hello, World! appear. Congragulations! You have written a complete working Visual Basic program using this Hello, World tutorial. Read some of our other VB6 tutorials to learn how powerful this language really is. Object Types and Naming Scheme This tutorial explains all the different aspects of Visual Basic data types and constructs. It also gives suggestions as to how to name your different VB6 items. These are very important things to remember in order to make your source code more easily intelligible. File Types You will use various file types while using VB6. These are some the most common ones.  File type: What people call it  Prefix: What people prefix the filename with  Extension: What file extension is used  Description: What its used for most often File Type Prefix Extension Description Project vbp General project options Form frm frm GUI information and private code BAS Module mod bas Project-wide accessible functions Class Module cls cls Project-wide accessible subroutines User Control uc ctl Control object (Like an OCX with source code) Property page pag pag Property information
  • 13. www.ThesisScientist.com OLE Control ocx Compiled control object Dynamic Link Lib dll Subs and functions accessible by other programs Examples of common file names:  OddCalc.vbp  frmMain.frm  frmAbout.frm  frmPrintInvoice.frm  modMain.bas  modSettings.bas  modDeclares.bas  modWinsock.bas  clsWinsock.cls  ucCustomButton.ctl  ucTreeView.ctl  ucWinsock.ctl Variables A variable is a word or letter used to reference data used in a program. At the most basic level: All variables used in a program (Even if its interpreted as text) are held on the computer as a sequence of 1s and 0s (Binary) which represent numbers, which may or may not in turn represent letters or any given ASCII character. In a sane programmer's code the variable names are easy to understand because they clearly state what the variable is used for inside of the variable name. The information to be conveyed in a variable name is: 1. Variable data type 2. Functional use in program This is accomplished by coming up with a unique word between about 3 and 10 letters which explains the functional use of the variable as well as a prefix of usually 3 letters which explains the variable data type. A few examples of this:  intResult -- An integer which is the result of an operation  strFirstName -- A string which is used to store the first name of a person
  • 14. www.ThesisScientist.com  dtmWorkDayEnd -- A Date variable which is used to store the time of the end of the work day Computer Data Storage All data stored on a computer is based upon binary values associated with them somewhere between 0 and 255. This is the range of values possible with an 8 bit binary value (8 ones and zeroes). Decimal Binary Hexadecimal ASCII 48 0b00110000 0x30 0 49 0b00110001 0x31 1 50 0b00110010 0x32 2 ------- --------------- --------- ----- 55 0b00110111 0x37 7 56 0b00111000 0x38 8 57 0b00111001 0x39 9 ------- --------------- --------- ----- 65 0b01000001 0x41 A 66 0b01000010 0x42 B 67 0b01000011 0x43 C ------- --------------- --------- ----- 88 0b01011000 0x58 X 89 0b01011001 0x59 Y 90 0b01011010 0x5A Z ------- --------------- --------- ----- 97 0b01100001 0x61 a 98 0b01100010 0x62 b 99 0b01100011 0x63 c
  • 15. www.ThesisScientist.com ------- --------------- --------- ----- 120 0b01111000 0x78 x 121 0b01111001 0x79 y 122 0b01111010 0x7A z A text character's "ASCII value" is the decimal value of the binary value used to represent that character on the computer. In the case of the uppercase letters A, the ASCII value is 65, which is 01000001 in binary. Uppercase Z has an ASCII value of 90, which is 1011010 in binary. The values for uppercase letters A through Z are between the values 65 and 90. Anybody notice how similar the uppercase and lower case values are in binary and hex? In binary you toggle the 32's place in order to change case, and in hex you add/subtract 2 from the 16's place. Handy. Associated example to play with: 1. Option Explicit 2. Private Sub Form_Load() 3. Dim strChar As String ' Declares a variable 4. 5. ' Shows an input box and puts the result in a variable called strChar 6. strChar = InputBox("What would you like the ASCII value of?", "HUH!? PUNK!?", "A") 7. 8. ' Shows a message box containing the ASCII value of the previously input letter 9. ' plus a random ASCII uppercase letter 10. MsgBox "The ASCII value of " & strChar & " is " & Asc(strChar) & vbNewLine & _ 11. "And your random, uppercase ASCII character is: " & _ 12. Chr$(RandomNumInRange(65, 90)) 13. ' Unloads the form (Which cleanly ends the program if no other forms are loaded) 14. Unload Me 15. End Sub 16. Public Function RandomNumInRange(ByVal Low As Long, ByVal High As Long) As Long 17. Randomize ' Randomizes Rnd() (Surprisingly good random number generator) 18. 19. ' Generates a random number between "High" and "Low" and returns it 20. RandomNumInRange = Int((High - Low + 1) * Rnd) + Low 21. End Function
  • 16. www.ThesisScientist.com Variable Names The following are the requirements when naming the variables in Visual Basic:  It must be less than 255 characters  No spacing is allowed  It must not begin with a number  Period is not permitted For the sake of making sure other people can look at your code and know what you were thinking:  Suffix your variable name with the appropriate suffix for your variable's data type  Make sure the body of your variable name makes it easy to tell what its used for  Don't use an ambiguous name like "intUhhhh" or "strX" unless its use is within a very small scope of the program Numeric Data Types Type Size Range of Values Prefix Example Variable Name Byte 1 byte 0 to 255 byt bytFirstChar Integer 2 bytes -32,768 to 32,767 int intCount Long 4 bytes -2,147,483,648 to 2,147,483,648 lng lngHwnd Single 4 bytes Negative values: -3.402823E+38 to -1.401298E- 45 Positive values: 1.401298E-45 to 3.402823E+38 sng sngPi Double 8 bytes Negative values: -1.79769313486232e+308 to - 4.94065645841247E-324 Positive values: 4.94065645841247E-324 to 1.79769313486232e+308 dbl dblAngle Currency 8 bytes -922,337,203,685,477.5808 to 922,337,203,685,477.5807 cur curTotalCost
  • 17. www.ThesisScientist.com Non-numeric Data Types Type Size Range of Values Prefix Example Variable Name String(fixed length) Length of string 1 to 65,400 characters str strName String(variable length) Length + 10 bytes 0 to 2 billion characters str strHTML Date 8 bytes January 1, 100 to December 31, 9999 dtm dtmBirth Boolean 2 bytes True or False bln blnToggle Object 4 bytes Any embedded object obj objCurrent Variant(numeric) 16 bytes Any value as large as Double vnt vntNumber Variant(text) Length+22 bytes Same as variable-length string vnt vntName Control Types Control Type Prefix TextBox txt PictureBox pic Label lbl Frame fra CommandButton cmd CheckBox chk RadioButton rad ComboBox cbo ListBox lst Scroll Bar sbr (no orientation needed) Timer tmr DriveListBox drv DirListBox dir
  • 18. www.ThesisScientist.com FileListBox fil Shape shp Image img Data dat OLE ole ListView lvw TreeView tvw Examples of common object names:  txtName  txtAddress  cboYear  cmdOK  cmdCancel Hopefully this Visual Basic tutorial gave you good idea of all the different objects and data types in VB6. By following these naming standards and using the appropriate types in your code you will produce much better VB code. Understanding variable