ويب صور الأخبار مجموعات ترجمة إجابات Gmail المزيد »
المجموعات التي قمت بزيارتها مؤخرا | مساعدة | تسجيل الدخول
الصفحة الرئيسية لمجموعات Google
رسالة من مناقشة Fwd: VB3 & VB4

تم تحليل العرض - إظهار نص الرسالة فقط

Received: by 10.11.53.59 with SMTP id b59mr1794952cwa;
        Wed, 22 Feb 2006 05:14:57 -0800 (PST)
Return-Path: <vittal...@gmail.com>
Received: from wproxy.gmail.com (wproxy.gmail.com [64.233.184.196])
        by mx.googlegroups.com with ESMTP id v23si1811904cwb.2006.02.22.05.13.34;
        Wed, 22 Feb 2006 05:13:36 -0800 (PST)
Received-SPF: pass (googlegroups.com: domain of vittal...@gmail.com designates 64.233.184.196 as permitted sender)
DomainKey-Status: good (test mode)
Received: by wproxy.gmail.com with SMTP id 57so1354859wri
        for <rnsitvb@googlegroups.com>; Wed, 22 Feb 2006 05:13:34 -0800 (PST)
DomainKey-Signature: a=rsa-sha1; q=dns; c=nofws;
        s=beta; d=gmail.com;
        h=received:message-id:date:from:to:subject:in-reply-to:mime-version:content-type:references;
        b=SHMdUrZQv8QAMr5GJqZdvQSp69Q4eE7gOPosYQLpZF3zt9L6gsipOANg18w038yCVFI/UWnSoMzm8koB2HbDL1xVzERB5doDkw+xOBuM4GMebizpoE4mMigzZ1dCry5SF1LIjy5kpF11WQ2YxhV1IEXc8m6B/ggUmo5atDCvHqQ=
Received: by 10.54.98.5 with SMTP id v5mr3783961wrb;
        Wed, 22 Feb 2006 05:13:32 -0800 (PST)
Received: by 10.54.70.14 with HTTP; Wed, 22 Feb 2006 05:13:32 -0800 (PST)
Message-ID: <d8910e430602220513n7a13746ek6e89b1801844adcd@mail.gmail.com>
Date: Wed, 22 Feb 2006 18:43:32 +0530
From: Vittal <vittal...@gmail.com>
To: "RNS VB GROUP" <rnsitvb@googlegroups.com>
Subject: Fwd: VB3 & VB4
In-Reply-To: <20060222063117.27393.qmail@web8515.mail.in.yahoo.com>
Mime-Version: 1.0
Content-Type: multipart/alternative;
	boundary="----=_Part_10100_16166025.1140614012703"
References: <20060222063117.27393.qmail@web8515.mail.in.yahoo.com>

------=_Part_10100_16166025.1140614012703
Content-Type: text/plain; charset=ISO-8859-1
Content-Transfer-Encoding: quoted-printable

---------- Forwarded message ----------
From: vittal <vittal...@yahoo.co.in>
Date: Feb 22, 2006 12:01 PM
Subject: VB3 & VB4
To: Vittal P <vittal...@gmail.com>

  Profsr.com <http://profsr.com/>



[image: Previous page] Previous
<http://www.profsr.com/vb/vbless02.htm>     [image:
TOC] Contents <http://www.profsr.com/vb/vbintro.htm#content>     [image:
Next page]Next <http://www.profsr.com/vb/vbless04.htm>

 ------------------------------
 LESSON 3 -- Designing the application



Starting the process When you start to work on a VB Project you are no
longer just a programmer - you are now a developer. You will have to get
much more involved in the whole design process. Unless you are designing an
application for your own use you will have to work with a team of
specialists including, but not limited to, *users, analysts, GUI designer,
programmers, testers, network specialist, webmaster and marketing people*.
The whole process is iterative - do part of it, check it, get input, go bac=
k
and correct it, do the next part, and so on. Nobody expects you to do a
whole project in one fell swoop - it would probably be a disaster if you di=
d
do it that way.

The importance of UsersAny project that you develop has to involve
*Users.*They are the people who will sit in front of your interface
for eight hours
a day and decide if they like it or not. If they don't like it, no matter
how efficient the code and how many millions of dollars were spent
developing it, they will find ways to sabotage it.

Get users involved from the start. If you are developing a product to specs=
,
that is to be sold to some client eventually, there has to be someone who
knows what that eventual client needs. Find a typical user of the product t=
o
use as a sounding board. Remember: you are just the developer; no matter ho=
w
cool you think it would be to use all purple text on orange backgrounds, it
is the user who will tell you what is cool and what is not. As you develop
more and more parts of the application, run them by the user to check for
accuracy, completeness, clarity, etc.

Here's an example of how to design for *clarity*. Given that 01/02/03 is a
date, what date is it? If you are an American, you probably automatically
assume that it is January 2nd, 2003. If your user is French, however, he
would assume that it is February 1st, 2003. And if you are working with thi=
s
Professor, who has a very definite opinion on the subject, he would say tha=
t
it is February 3rd, 2001 and should always be written as 2001-02-03. If all
your forms are designed as: "Enter date" with a blank box beside it, you ar=
e
headed for trouble.


  *Program design today is a race between software engineers striving to
build bigger and better idiot-proof programs, and the Universe trying to
produce bigger and better idiots. So far, the Universe is winning.*
-- Rich Cook




That's just a joke, by the way. Most users are not idiots. Sometimes they
appear confused because they are trying to solve the problem and they can't
figure out how. But that's not their job. Their job is to explain clearly
what it is they need. Your job is to figure out how to provide it. Don't
underestimate users. Be patient, be understanding without being
condescending and be humble. There's a lot of things that the user knows ho=
w
to do that you don't.










Creating the User InterfaceThe user interface that you design is the most
visible and perhaps the most important part of the application. The term
commonly used for this type of interface is: *GUI (Graphical User Interface=
)
*. It's pronounced "goo-wee", not "guy". It is graphical because it consist=
s
of buttons, menus, icons, etc. An example of a non-GUI is DOS (remember
that?) where everything is text. User interface refers to the fact that it
is the part of the application between the user, in front of the screen, an=
d
the code behind the screen. How well the user can interact with the code
depends on the quality of the interface.

Top <http://www.profsr.com/vb/vbless03.htm#Start>
Guiding principles

   - The user is in control. The user must feel he is in charge of the
   application. He must have a certain amount of control over such things a=
s
   window size, window position, choice of fonts, etc. There should definit=
ely
   be a "Preferences" item in the menu.

   - Consistency is maintained throughout the application. The user can
   move to any part of the application and not have to re-learn how things
   work. Consistency in the choice of icons, in date formats, in error mess=
ages
   means that the user can concentrate on the work. As much as possible, th=
e
   application should be consistent with Windows standard. For example, "Mo=
ve
   to the Recycle Bin" is different from "Delete" - the user has come to ex=
pect
   that an item in the Recycle Bin can be recovered if need be.

   - Application should be "forgiving", or "fault-tolerant". Users will
   make mistake. A single error should not bring the application crashing t=
o
   the floor. If there is no room for errors, users will be afraid to
   experiment, to discover on their own how to do things. It will slow the
   learning process considerably.

   - Always supply feedback. The user should always know that something
   is going on, especially if it's in the background and may take several
   minutes to run. Display an hourglass or a progress meter or a status bar=
 so
   that the user doesn't start to hit keys at random to get something to
   happen. It only takes a few seconds of inactivity for the user to get
   frustrated and think that the program is "hanging".

   - Don't neglect esthetics. The visual aspect is important. The
   environment should be pleasing to the eye. The presentation style should
   help in understanding the information presented.

   - Interface should be simple without being simplistic. There should be
   a balance between simplicity and functionality. Popup menus, for example=
,
   allow you to increase the functionality without having to encumber the
   screen with all kinds of details which are not used 95% of the time.




   *On the importance of language*

Throughout the project you are going to be doing, you should give some
thought to the quality of the language used. As a teacher of technology, I
am constantly defending the compulsory language courses included in the
curriculum. I have to point out that your mastery of the language, or lack
thereof, projects an image of who and what you are. You don't have to go
very far to see an example of this at work: just look at President George W=
.
Bush. I have never met the man and I have no idea whether he is smart or
dumb. But the media certainly have an opinion - just watch "The Tonight Sho=
w
with Jay Leno" just about any night. They have tagged him as an idiot, not
because of what he thinks but because of some mistakes he made while he was
speaking. This is the 21st Century - image is everything!

When I was young, a long, long time ago, in a galaxy far, far away, teacher=
s
used to say all the time: "Sloppy work is the sign of a sloppy mind!". The
President notwithstanding, there is a lot of truth in that. If you can't be
bothered to display the interface correctly, what does that say about the
rest of your work? Professionalism should be evident in every part of what
you create. If what is seen by the public is shoddy, there is reason to
believe that the work behind the interface (90% of the application) is also
shoddy.

If you are developping an application for yourself, nobody cares what it
looks like. If it's a small project for a client that you know, you may be
able to get away with some mistakes. Usually however, a project is broader
in scope and you don't know the audience. Remember that you are now working
in the global village. The interface you write and display may be seen, via
the Internet, by millions and millions of critical users. Even if it's not
your reputation riding on it, the reputation of your client may be. And you
can be sure that he will take it seriously, even if you don't. If language
is not your area of expertise, get help from somebody whose area it is.

Having said all that, I realize that I am really sticking my neck out.
Although every effort has been made to make these tutorials as error-free a=
s
possible, it is inevitable that some mistakes will slip through. You are
allowed to say, "Gotcha!" when you spot mistakes. Accept my apology and I
will correct all errors as soon as they are spotted.

*To err is human.
But it takes the Web to let millions of people know that you erred!*





Top <http://www.profsr.com/vb/vbless03.htm#Start>






Interface styleOne of the first decisions you have to make is whether to go
*SDI (Single Document Interface)* or *MDI (Multiple Document Interface).* I=
f
you have worked with Windows for any length of time, you have probably seen
both. Notepad is an SDI - you can only have one document open at any time.
Word is an MDI - you can open a number of documents and switch between them
at will. An MDI application imposes different constraints on the developer
because of the need to juggle several different forms at the same time. It
usually requires more experience in the development process. For the
purposes of this tutorial, we will work only with SDI applications.

Design considerations

   - What is the purpose of the application? Is it a once-a-year thing or
   one that is in use 24/7? The user will forget the details if he only use=
s it
   once a year and you will have to be a lot more specific with the Help
   functions.

   - Who is the intended audience? Beginning users will need more
   directions than experienced users.

   - How many different forms will be needed (you can have several forms
   without being MDI) and how will they be connected?

   - What are the menus going to say? Will toolbars be used to replicate
   menu functions?

   - How are errors going to be identified to the user? How will they be
   corrected?

   - How much Help (in the form of a Help function) is going to be
   provided?

   - How will consistency be maintained across the application? It is
   important that all forms have the same "look and feel" in terms of color=
s,
   fonts, menus, toolbars, etc.


We will examine the design process in more detail as we develop the Project=
s
in the following lessons. If you are serious about the design aspect of
software, one of the best sources of information is the book: *"The Windows
Interface Guidelines for Software Design"* published by *Microsoft Press*,
reference *ISBN 1-55615-679-0*.








 ------------------------------


Top <http://www.profsr.com/vb/vbless03.htm#Start>



Home <http://www.profsr.com/>               =20
Tutorials<http://www.profsr.com/home3.html>


  Profsr.com <http://profsr.com/>



[image: Previous page] Previous
<http://www.profsr.com/vb/vbless03.htm>     [image:
TOC] Contents <http://www.profsr.com/vb/vbintro.htm#content>     [image:
Next page]Next <http://www.profsr.com/vb/vbless05.htm>

 ------------------------------
 LESSON 4 -- Standard controls




For this lesson we will need a *new Project*, call it *Lesson4.vbp*, which
will only be used to create and try out various controls.

To refresh your memory, since the previous two lessons have been rather
theoretical, you select the New tab, and Standard EXE** for the type. As
soon as The Form opens, you *Save* the new Project, *give the Form a name*,
let's say it's Lesson4.frm and then you *give the Project a name:*
Lesson4.vbp. Note that you do not have to specify the extensions, .frm and
.vbp, because they will be assigned automatically.

The FormWe covered it too briefly in Lesson1 so we'll go over it again. The
Form is the first object you see when you Open the application. It is the
window into which all the controls will appear, where you will input data
and see results.



There's not too much you can do with the form, at this time. Basically, you
adjust the *BackColor* and the *StartUpPosition* (where it will open on the
screen when you Run it) and then you start putting controls on it.



The LabelThis is probably the first control you will master. It is used to
display static text, titles and screen output from operations. The importan=
t
properties to remember:

   - Caption - the text that is displayed in the label
   - BackColor and ForeColor - colors of the background and the text
   - BackStyle - Opaque or Transparent - whether the background is
   visible or not
   - Font - font and size of text
   - Alignment - text centered, left or right
   - Multiline- True or False - if True, you can have several lines of
   text, delimited by <CR> in the label - by default, it is set to False



Frame PictureBoxWhen you want to group several controls together - name and
address, for example - you use a *Frame*. The frame backcolor can be the
same as the form's and only the frame borders will be obvious, or it can be
a different color and stand out.

You create the frame before the controls. When you create controls in a
frame, they are tied to the frame and move with it. The frame caption is th=
e
text that appears at the top of the frame - you use it to define the group.

The *PictureBox* is like a Label with a picture in it instead of text.
The *Picture
property* determines the name of the file, .BMP or .GIF, that will be
displayed. It can be used for a company logo, etc.



Top <http://www.profsr.com/vb/vbless04.htm#Start>








TextBox CommandButtonThe TextBox is like a Label but, it is used to input
data into the program. The data typed in is in the *Text* property of the
control.

When the program is Run, only the controls that can be manipulated will be
activated. For example, if the form contains 3 Labels, 3 TextBoxes and 3
Buttons, when it is Run, the cursor will not stop at the labels.

When the user hits the Tab key, the cursor will go to the first TextBox or
Button - not necessarily the first one on the form but, the first one that
was created. That is called the *Tab order* and you have to specify it.

On the form there is only one control at any given time that has the cursor
on it - it is said to have *Focus*. If you type data, the control with Focu=
s
will receive it. You change the Focus with Tab or by clicking on a differen=
t
control.

   Up until now we haven't bothered with the names of controls (the Name
property). Once we start to code, however, it does become important. There
are all kinds of occasions in code where you have to call upon a certain
control. It can get very confusing when your 12 buttons are called
Command1...Command12. What did Command7 do, again? Give each control a name
(except for titles, etc. that you never refer to) so that you will be able
to identify it easily. It is recommended that you use a prefix when
assigning a name; cmd for a CommandButton, lbl for a Label, txt for a
TextBox. Thus, txtNumber where you input the value can be distinguished fro=
m
lblNumber where you display the result.


The CommandButton is used to initiate actions, usually by clicking on it.
The Caption property determines the text to display on the face of the
button. The *Default* property, if set to true, means that the button will
be activated (same as Clicked) if the <Enter> key is hit anywhere in the
form. If *Cancel* is set to True, the button will be activated from anywher=
e
in the form by the <Esc> key.



Hopefully, you have now run this program several times, each time you added
a new control, in fact. Admittedly, nothing much happened except to confirm
that the controls were appearing in the right place on the form.

Here now is an example of the code we could write to perform simple tasks:
input name and city and display the information in a label when the Continu=
e
button is clicked. The Exit button will end execution of the program and th=
e
Cancel button (or the Esc key) will clear the fields.



A few explanations: the Form_Load event occurs when the form first opens.
This is where we initialize things - we want the TextBoxes and the result
Label to be empty when we start off so, we set them to a blank space.

The actual processing is done after the data have been entered and we hit
the Continue button. The processing logic is put in the
Continue_button_clicked event.

When you hit the <Esc> key or you click on the Cancel button, you want to
annul the entry you're doing and start over again. That's the same as
opening the form so, we just tell the program to execute the Form_Load
procedure which we already have.

The Exit button uses the *pronoun Me* to Unload. *Me* means *the form
currently active* without having to name it.

Top <http://www.profsr.com/vb/vbless04.htm#Start>



    *Multiple forms*


For the next series of examples we will use a new Form. It is not necessary
to create a new Project; any Project can have several Forms in it.

With the Project open on the current Form, go to: Menu --> Project --> Add
form. Select New form in the creation window and, voila! Next time you save
the Project, it will ask you to name this new Form. You can name it
Lesson4B.frm for example.

One more detail: when you Run the Project, you want to tell it which Form t=
o
open.

Go to the *Project Manager window*, right click on the Project name and
select *Project properties*. In the Project properties window, the ListBox
on the right says "*Startup object*". Select the Form you want to open when
you Run. You can change the Startup object at any time to run the different
forms that you created.









Check boxes Option buttonsThese two controls are used when the user must
choose from a list of options. The difference between the two is that with
Check boxes he can select several at one time but, with Option buttons, he
must select only one among several.

The example below illustrates the use of Check boxes and Option buttons. To
capture the information entered by means of these controls, you must test
the *property: Value.* In a Check box, *Value =3D 1 if box is checked and =
=3D 0
if not.* In an Option button, *Value =3D True if selected and =3D False if =
not.*



The code, although somewhat long, is not very complicated. Most of the time=
,
processing consists of checking the content of .Value. It is fairly standar=
d
procedure, especially with Option buttons, to ensure that at least one
button has been selected and to display an error message if it has not.








Assignment 3Create the Payroll form shown below. Number of hours must be
entered as well as the appropriate rate. Gross salary =3D rate * hours. Net
salary =3D gross salary - deductions.









 ------------------------------


Top <http://www.profsr.com/vb/vbless04.htm#Start>



Home <http://www.profsr.com/>               =20
Tutorials<http://www.profsr.com/home3.html>


 ------------------------------
Jiyo cricket on Yahoo! India
cricket<http://us.rd.yahoo.com/mail/in/mailcricket/*http://in.sports.yahoo.=
com/cricket/>
Yahoo! Messenger
Mobile<http://us.rd.yahoo.com/mail/in/mailmobilemessenger/*http://in.mobile=
.yahoo.com/new/messenger/>Stay
in touch with your buddies all the time.

------=_Part_10100_16166025.1140614012703
Content-Type: text/html; charset=ISO-8859-1
Content-Transfer-Encoding: quoted-printable

<br><br>---------- Forwarded message ----------<br><span class=3D"gmail_quo=
te">From: <b class=3D"gmail_sendername">vittal</b> &lt;<a href=3D"mailto:vi=
ttal...@yahoo.co.in">vittal...@yahoo.co.in</a>&gt;<br>Date: Feb 22, 2006 12=
:01 PM
<br>Subject: VB3 &amp; VB4<br>To: Vittal P &lt;<a href=3D"mailto:vittalp88@=
gmail.com">vittal...@gmail.com</a>&gt;<br><br></span>
<table width=3D"100%" border=3D"0">
<tbody>
<tr>
<td valign=3D"top"><a name=3D"10990745f133ca52_Start"></a>
<div><a onclick=3D"return top.js.OpenExtLink(window,event,this)" href=3D"ht=
tp://profsr.com/" target=3D"_blank">Profsr.com</a> </div>
<div align=3D"center"><font color=3D"#400080"><img src=3D"http://www.profsr=
.com/images/vbpic4.gif" border=3D"0"><br><br></font></div></td></tr>
<tr>
<td align=3D"right"><br>
<div><a title=3D"Free Visual Basic 6 lesson" onclick=3D"return top.js.OpenE=
xtLink(window,event,this)" href=3D"http://www.profsr.com/vb/vbless02.htm" t=
arget=3D"_blank"><img height=3D"31" alt=3D"Previous page" src=3D"http://www=
.profsr.com/images/cy_l_arr.gif" width=3D"31" border=3D"0">
 Previous</a>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<a title=3D"Visual Basic 6.0 tra=
ining" onclick=3D"return top.js.OpenExtLink(window,event,this)" href=3D"htt=
p://www.profsr.com/vb/vbintro.htm#content" target=3D"_blank"><img height=3D=
"31" alt=3D"TOC" src=3D"http://www.profsr.com/images/cy_u_arr.gif" width=3D=
"31" border=3D"0">
 Contents</a>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<a onclick=3D"return top.js.Open=
ExtLink(window,event,this)" href=3D"http://www.profsr.com/vb/vbless04.htm" =
target=3D"_blank"><img height=3D"31" alt=3D"Next page" src=3D"http://www.pr=
ofsr.com/images/cy_r_arr.gif" width=3D"31" border=3D"0">
Next</a></div><br></td></tr>
<tr>
<td>
<hr width=3D"95%">

<div>
<div align=3D"center">
<h2>LESSON 3 -- Designing the application</h2></div><br>
<div align=3D"center"><img height=3D"1" src=3D"http://pagead2.googlesyndica=
tion.com/pagead/imp.gif?event=3Dnoiframe&amp;client=3Dca-pub-90232639759559=
96&amp;dt=3D1140589434218&amp;lmt=3D1129335723&amp;format=3D336x280_as&amp;=
output=3Dhtml&amp;url=3Dhttp%3A%2F%2Fwww.profsr.com%2Fvb%2Fvbless03.htm&amp=
;color_bg=3DFFFFFF&amp;color_text=3D000003&amp;color_link=3D003399&amp;colo=
r_url=3D000003&amp;color_border=3DFFFFFF&amp;ad_type=3Dtext_image&amp;ref=
=3Dhttp%3A%2F%2Fwww.profsr.com%2Fvb%2Fvbintro.htm&amp;cc=3D2050&amp;u_h=3D7=
68&amp;u_w=3D1024&amp;u_ah=3D740&amp;u_aw=3D1024&amp;u_cd=3D32&amp;u_tz=3D3=
30&amp;u_his=3D1&amp;u_java=3Dtrue" width=3D"1" border=3D"0">
</div><br><br>
<h3>Starting the process</h3>
<div>When you start to work on a VB Project you are no longer just a progra=
mmer - you are now a developer. You will have to get much more involved in =
the whole design process. Unless you are designing an application for your =
own use you will have to work with a team of specialists including, but not=
 limited to,=20
<b>users, analysts, GUI designer, programmers, testers, network specialist,=
 webmaster and marketing people</b>. The whole process is iterative - do pa=
rt of it, check it, get input, go back and correct it, do the next part, an=
d so on. Nobody expects you to do a whole project in one fell swoop - it wo=
uld probably be a disaster if you did do it that way.
<br><br>
<h3>The importance of Users</h3>Any project that you develop has to involve=
 <b>Users.</b> They are the people who will sit in front of your interface =
for eight hours a day and decide if they like it or not. If they don't like=
 it, no matter how efficient the code and how many millions of dollars were=
 spent developing it, they will find ways to sabotage it.=20
<br><br>Get users involved from the start. If you are developing a product =
to specs, that is to be sold to some client eventually, there has to be som=
eone who knows what that eventual client needs. Find a typical user of the =
product to use as a sounding board. Remember: you are just the developer; n=
o matter how cool you think it would be to use all purple text on orange ba=
ckgrounds, it is the user who will tell you what is cool and what is not. A=
s you develop more and more parts of the application, run them by the user =
to check for accuracy, completeness, clarity, etc.
<br><br>Here's an example of how to design for <b>clarity</b>. Given that 0=
1/02/03 is a date, what date is it? If you are an American, you probably au=
tomatically assume that it is January 2nd, 2003. If your user is French, ho=
wever, he would assume that it is February 1st, 2003. And if you are workin=
g with this Professor, who has a very definite opinion on the subject, he w=
ould say that it is February 3rd, 2001 and should always be written as 2001=
-02-03. If all your forms are designed as: &quot;Enter date&quot; with a bl=
ank box beside it, you are headed for trouble.
<br><br><br>
<div align=3D"center">
<table width=3D"55%" bgcolor=3D"#408080" border=3D"1">
<tbody>
<tr>
<td><b><font color=3D"#ffffff">Program design today is a race between softw=
are engineers striving to build bigger and better idiot-proof programs, and=
 the Universe trying to produce bigger and better idiots. So far, the Unive=
rse is winning.
</font></b><br>-- Rich Cook <br></td></tr></tbody></table><br><br><br>&nbsp=
;</div>That's just a joke, by the way. Most users are not idiots. Sometimes=
 they appear confused because they are trying to solve the problem and they=
 can't figure out how. But that's not their job. Their job is to explain cl=
early what it is they need. Your job is to figure out how to provide it. Do=
n't underestimate users. Be patient, be understanding without being condesc=
ending and be humble. There's a lot of things that the user knows how to do=
 that you don't.=20
<br><br><br>&nbsp;</div><br><br><br><br>
<div align=3D"center"><img height=3D"1" src=3D"http://pagead2.googlesyndica=
tion.com/pagead/imp.gif?event=3Dnoiframe&amp;client=3Dca-pub-90232639759559=
96&amp;dt=3D1140589435578&amp;lmt=3D1129335723&amp;prev_fmts=3D336x280_as&a=
mp;format=3D336x280_as&amp;output=3Dhtml&amp;url=3Dhttp%3A%2F%2Fwww.profsr.=
com%2Fvb%2Fvbless03.htm&amp;color_bg=3DFFFFFF&amp;color_text=3D000003&amp;c=
olor_link=3D003399&amp;color_url=3D000003&amp;color_border=3DFFFFFF&amp;ad_=
type=3Dtext_image&amp;ref=3Dhttp%3A%2F%2Fwww.profsr.com%2Fvb%2Fvbintro.htm&=
amp;cc=3D2050&amp;u_h=3D768&amp;u_w=3D1024&amp;u_ah=3D740&amp;u_aw=3D1024&a=
mp;u_cd=3D32&amp;u_tz=3D330&amp;u_his=3D1&amp;u_java=3Dtrue" width=3D"1" bo=
rder=3D"0">
</div><br><br><br>
<h3>Creating the User Interface</h3>The user interface that you design is t=
he most visible and perhaps the most important part of the application. The=
 term commonly used for this type of interface is: <b>GUI (Graphical User I=
nterface)
</b>. It's pronounced &quot;goo-wee&quot;, not &quot;guy&quot;. It is graph=
ical because it consists of buttons, menus, icons, etc. An example of a non=
-GUI is DOS (remember that?) where everything is text. User interface refer=
s to the fact that it is the part of the application between the user, in f=
ront of the screen, and the code behind the screen. How well the user can i=
nteract with the code depends on the quality of the interface.
<br><br>
<div align=3D"center"><a onclick=3D"return top.js.OpenExtLink(window,event,=
this)" href=3D"http://www.profsr.com/vb/vbless03.htm#Start" target=3D"_blan=
k">Top</a></div>
<h4>Guiding principles</h4>
<ul>
<li>The user is in control. The user must feel he is in charge of the appli=
cation. He must have a certain amount of control over such things as window=
 size, window position, choice of fonts, etc. There should definitely be a =
&quot;Preferences&quot; item in the menu.
<br><br>
<li>Consistency is maintained throughout the application. The user can move=
 to any part of the application and not have to re-learn how things work. C=
onsistency in the choice of icons, in date formats, in error messages means=
 that the user can concentrate on the work. As much as possible, the applic=
ation should be consistent with Windows standard. For example, &quot;Move t=
o the Recycle Bin&quot; is different from &quot;Delete&quot; - the user has=
 come to expect that an item in the Recycle Bin can be recovered if need be=
.=20
<br><br>
<li>Application should be &quot;forgiving&quot;, or &quot;fault-tolerant&qu=
ot;. Users will make mistake. A single error should not bring the applicati=
on crashing to the floor. If there is no room for errors, users will be afr=
aid to experiment, to discover on their own how to do things. It will slow =
the learning process considerably.
<br><br>
<li>Always supply feedback. The user should always know that something is g=
oing on, especially if it's in the background and may take several minutes =
to run. Display an hourglass or a progress meter or a status bar so that th=
e user doesn't start to hit keys at random to get something to happen. It o=
nly takes a few seconds of inactivity for the user to get frustrated and th=
ink that the program is &quot;hanging&quot;.
<br><br>
<li>Don't neglect esthetics. The visual aspect is important. The environmen=
t should be pleasing to the eye. The presentation style should help in unde=
rstanding the information presented.<br><br>
<li>Interface should be simple without being simplistic. There should be a =
balance between simplicity and functionality. Popup menus, for example, all=
ow you to increase the functionality without having to encumber the screen =
with all kinds of details which are not used 95% of the time.
<br><br></li></li></li></li></li></li></ul><br><br>
<div align=3D"center">
<table width=3D"60%" bgcolor=3D"#ffffcc">
<tbody>
<tr>
<td>
<div align=3D"center"><b>On the importance of language</b></div><br>Through=
out the project you are going to be doing, you should give some thought to =
the quality of the language used. As a teacher of technology, I am constant=
ly defending the compulsory language courses included in the curriculum. I =
have to point out that your mastery of the language, or lack thereof, proje=
cts an image of who and what you are. You don't have to go very far to see =
an example of this at work: just look at President George W. Bush. I have n=
ever met the man and I have no idea whether he is smart or dumb. But the me=
dia certainly have an opinion - just watch &quot;The Tonight Show with Jay =
Leno&quot; just about any night. They have tagged him as an idiot, not beca=
use of what he thinks but because of some mistakes he made while he was spe=
aking. This is the 21st Century - image is everything!
<br><br>When I was young, a long, long time ago, in a galaxy far, far away,=
 teachers used to say all the time: &quot;Sloppy work is the sign of a slop=
py mind!&quot;. The President notwithstanding, there is a lot of truth in t=
hat. If you can't be bothered to display the interface correctly, what does=
 that say about the rest of your work? Professionalism should be evident in=
 every part of what you create. If what is seen by the public is shoddy, th=
ere is reason to believe that the work behind the interface (90% of the app=
lication) is also shoddy.
<br><br>If you are developping an application for yourself, nobody cares wh=
at it looks like. If it's a small project for a client that you know, you m=
ay be able to get away with some mistakes. Usually however, a project is br=
oader in scope and you don't know the audience. Remember that you are now w=
orking in the global village. The interface you write and display may be se=
en, via the Internet, by millions and millions of critical users. Even if i=
t's not your reputation riding on it, the reputation of your client may be.=
 And you can be sure that he will take it seriously, even if you don't. If =
language is not your area of expertise, get help from somebody whose area i=
t is.=20
<br><br>Having said all that, I realize that I am really sticking my neck o=
ut. Although every effort has been made to make these tutorials as error-fr=
ee as possible, it is inevitable that some mistakes will slip through. You =
are allowed to say, &quot;Gotcha!&quot; when you spot mistakes. Accept my a=
pology and I will correct all errors as soon as they are spotted.
<br><br>
<div align=3D"center"><b>To err is human.<br>But it takes the Web to let mi=
llions of people know that you erred!</b></div><br><br></td></tr></tbody></=
table></div><br><br><br>
<div align=3D"center"><a onclick=3D"return top.js.OpenExtLink(window,event,=
this)" href=3D"http://www.profsr.com/vb/vbless03.htm#Start" target=3D"_blan=
k">Top</a></div><br><br><br>
<div align=3D"center"><img height=3D"1" src=3D"http://pagead2.googlesyndica=
tion.com/pagead/imp.gif?event=3Dnoiframe&amp;client=3Dca-pub-90232639759559=
96&amp;dt=3D1140589436796&amp;lmt=3D1129335723&amp;prev_fmts=3D336x280_as%2=
C336x280_as&amp;format=3D728x15_0ads_al&amp;output=3Dhtml&amp;url=3Dhttp%3A=
%2F%2Fwww.profsr.com%2Fvb%2Fvbless03.htm&amp;color_bg=3DFFFFFF&amp;color_te=
xt=3D000003&amp;color_link=3D003399&amp;color_url=3D000003&amp;color_border=
=3DFFFFFF&amp;ref=3Dhttp%3A%2F%2Fwww.profsr.com%2Fvb%2Fvbintro.htm&amp;cc=
=3D2050&amp;u_h=3D768&amp;u_w=3D1024&amp;u_ah=3D740&amp;u_aw=3D1024&amp;u_c=
d=3D32&amp;u_tz=3D330&amp;u_his=3D1&amp;u_java=3Dtrue" width=3D"1" border=
=3D"0">
</div><br><br><br>
<h4>Interface style</h4>One of the first decisions you have to make is whet=
her to go <b>SDI (Single Document Interface)</b> or <b>MDI (Multiple Docume=
nt Interface).</b> If you have worked with Windows for any length of time, =
you have probably seen both. Notepad is an SDI - you can only have one docu=
ment open at any time. Word is an MDI - you can open a number of documents =
and switch between them at will. An MDI application imposes different const=
raints on the developer because of the need to juggle several different for=
ms at the same time. It usually requires more experience in the development=
 process. For the purposes of this tutorial, we will work only with SDI app=
lications.
<br><br>
<h4>Design considerations</h4>
<ul>
<li>What is the purpose of the application? Is it a once-a-year thing or on=
e that is in use 24/7? The user will forget the details if he only uses it =
once a year and you will have to be a lot more specific with the Help funct=
ions.
<br><br>
<li>Who is the intended audience? Beginning users will need more directions=
 than experienced users.<br><br>
<li>How many different forms will be needed (you can have several forms wit=
hout being MDI) and how will they be connected?<br><br>
<li>What are the menus going to say? Will toolbars be used to replicate men=
u functions?<br><br>
<li>How are errors going to be identified to the user? How will they be cor=
rected?<br><br>
<li>How much Help (in the form of a Help function) is going to be provided?=
<br><br>
<li>How will consistency be maintained across the application? It is import=
ant that all forms have the same &quot;look and feel&quot; in terms of colo=
rs, fonts, menus, toolbars, etc.<br><br></li></li></li></li></li></li>
</li></ul>We will examine the design process in more detail as we develop t=
he Projects in the following lessons. If you are serious about the design a=
spect of software, one of the best sources of information is the book:=20
<b>&quot;The Windows Interface Guidelines for Software Design&quot;</b> pub=
lished by <b>Microsoft Press</b>, reference <b>ISBN 1-55615-679-0</b>.<br><=
br><br><br><br><br>
<div align=3D"center"><img height=3D"1" src=3D"http://pagead2.googlesyndica=
tion.com/pagead/imp.gif?event=3Dnoiframe&amp;client=3Dca-pub-90232639759559=
96&amp;dt=3D1140589438578&amp;lmt=3D1129335723&amp;prev_fmts=3D336x280_as%2=
C336x280_as%2C728x15_0ads_al&amp;format=3D336x280_as&amp;output=3Dhtml&amp;=
url=3Dhttp%3A%2F%2Fwww.profsr.com%2Fvb%2Fvbless03.htm&amp;color_bg=3DFFFFFF=
&amp;color_text=3D000003&amp;color_link=3D003399&amp;color_url=3D000003&amp=
;color_border=3DFFFFFF&amp;ad_type=3Dtext_image&amp;ref=3Dhttp%3A%2F%2Fwww.=
profsr.com%2Fvb%2Fvbintro.htm&amp;cc=3D2050&amp;u_h=3D768&amp;u_w=3D1024&am=
p;u_ah=3D740&amp;u_aw=3D1024&amp;u_cd=3D32&amp;u_tz=3D330&amp;u_his=3D1&amp=
;u_java=3Dtrue" width=3D"1" border=3D"0">
 </div><br><br><br>
<div align=3D"center">
<hr width=3D"90%">
<br><br><a onclick=3D"return top.js.OpenExtLink(window,event,this)" href=3D=
"http://www.profsr.com/vb/vbless03.htm#Start" target=3D"_blank">Top</a><br>=
<br><br><br><a title=3D"Free Microsoft Access, Visual Basic training" oncli=
ck=3D"return top.js.OpenExtLink(window,event,this)" href=3D"http://www.prof=
sr.com/" target=3D"_blank">
Home</a> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;=
&nbsp;&nbsp;&nbsp;&nbsp; <a title=3D"Free tutorials Access, VB, SQL" onclic=
k=3D"return top.js.OpenExtLink(window,event,this)" href=3D"http://www.profs=
r.com/home3.html" target=3D"_blank">Tutorials</a> </div></div><br><br></td>=
</tr>
</tbody></table>
<table width=3D"100%" border=3D"0">
<tbody>
<tr>
<td valign=3D"top"><a name=3D"10990745f133ca52_Start"></a>
<div><a onclick=3D"return top.js.OpenExtLink(window,event,this)" href=3D"ht=
tp://profsr.com/" target=3D"_blank">Profsr.com</a> </div>
<div align=3D"center"><font color=3D"#400080"><img src=3D"http://www.profsr=
.com/images/vbpic4.gif" border=3D"0"><br><br></font></div></td></tr>
<tr>
<td align=3D"right"><br>
<div><a title=3D"Free Visual Basic 6 lesson" onclick=3D"return top.js.OpenE=
xtLink(window,event,this)" href=3D"http://www.profsr.com/vb/vbless03.htm" t=
arget=3D"_blank"><img height=3D"31" alt=3D"Previous page" src=3D"http://www=
.profsr.com/images/cy_l_arr.gif" width=3D"31" border=3D"0">
 Previous</a>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<a title=3D"Visual Basic 6.0 tra=
ining" onclick=3D"return top.js.OpenExtLink(window,event,this)" href=3D"htt=
p://www.profsr.com/vb/vbintro.htm#content" target=3D"_blank"><img height=3D=
"31" alt=3D"TOC" src=3D"http://www.profsr.com/images/cy_u_arr.gif" width=3D=
"31" border=3D"0">
 Contents</a>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<a onclick=3D"return top.js.Open=
ExtLink(window,event,this)" href=3D"http://www.profsr.com/vb/vbless05.htm" =
target=3D"_blank"><img height=3D"31" alt=3D"Next page" src=3D"http://www.pr=
ofsr.com/images/cy_r_arr.gif" width=3D"31" border=3D"0">
Next</a></div><br></td></tr>
<tr>
<td>
<hr width=3D"95%">

<div>
<div align=3D"center">
<h2>LESSON 4 -- Standard controls</h2></div><br><br>
<div align=3D"center"><img height=3D"1" src=3D"http://pagead2.googlesyndica=
tion.com/pagead/imp.gif?event=3Dnoiframe&amp;client=3Dca-pub-90232639759559=
96&amp;dt=3D1140589680890&amp;lmt=3D1129335723&amp;format=3D336x280_as&amp;=
output=3Dhtml&amp;url=3Dhttp%3A%2F%2Fwww.profsr.com%2Fvb%2Fvbless04.htm&amp=
;color_bg=3DFFFFFF&amp;color_text=3D000003&amp;color_link=3D003399&amp;colo=
r_url=3D000003&amp;color_border=3DFFFFFF&amp;ad_type=3Dtext_image&amp;ref=
=3Dhttp%3A%2F%2Fwww.profsr.com%2Fvb%2Fvbintro.htm&amp;cc=3D2050&amp;u_h=3D7=
68&amp;u_w=3D1024&amp;u_ah=3D740&amp;u_aw=3D1024&amp;u_cd=3D32&amp;u_tz=3D3=
30&amp;u_his=3D1&amp;u_java=3Dtrue" width=3D"1" border=3D"0">
</div><br><br>
<div>For this lesson we will need a <b>new Project</b>, call it <b>Lesson4.=
vbp</b>, which will only be used to create and try out various controls.<br=
><br>To refresh your memory, since the previous two lessons have been rathe=
r theoretical, you select the New tab, and Standard EXE
<b></b> for the type. As soon as The Form opens, you <b>Save</b> the new Pr=
oject, <b>give the Form a name</b>, let's say it's Lesson4.frm and then you=
 <b>give the Project a name:</b> Lesson4.vbp. Note that you do not have to =
specify the extensions, .frm and .vbp, because they will be assigned automa=
tically.=20
<br><br>
<h3>The Form</h3>We covered it too briefly in Lesson1 so we'll go over it a=
gain. The Form is the first object you see when you Open the application. I=
t is the window into which all the controls will appear, where you will inp=
ut data and see results.
<br><br>
<div align=3D"center"><img height=3D"359" src=3D"http://www.profsr.com/imag=
es/vb04f01.gif" width=3D"561" border=3D"0"></div><br><br>There's not too mu=
ch you can do with the form, at this time. Basically, you adjust the <b>Bac=
kColor
</b> and the <b>StartUpPosition</b> (where it will open on the screen when =
you Run it) and then you start putting controls on it. <br><br>&nbsp;</div>=
<br>
<h3>The Label</h3>This is probably the first control you will master. It is=
 used to display static text, titles and screen output from operations. The=
 important properties to remember:=20
<ul>
<li>Caption - the text that is displayed in the label<br>
<li>BackColor and ForeColor - colors of the background and the text<br>
<li>BackStyle - Opaque or Transparent - whether the background is visible o=
r not<br>
<li>Font - font and size of text<br>
<li>Alignment - text centered, left or right<br>
<li>Multiline- True or False - if True, you can have several lines of text,=
 delimited by &lt;CR&gt; in the label - by default, it is set to False<br><=
/li></li></li></li></li></li></ul>
<div align=3D"center"><img height=3D"236" src=3D"http://www.profsr.com/imag=
es/vb04f02.gif" width=3D"565" border=3D"0"></div><br><br>
<h3>Frame</h3>
<h3>PictureBox</h3>When you want to group several controls together - name =
and address, for example - you use a <b>Frame</b>. The frame backcolor can =
be the same as the form's and only the frame borders will be obvious, or it=
 can be a different color and stand out.=20
<br><br>You create the frame before the controls. When you create controls =
in a frame, they are tied to the frame and move with it. The frame caption =
is the text that appears at the top of the frame - you use it to define the=
 group.=20
<br><br>The <b>PictureBox</b> is like a Label with a picture in it instead =
of text. The <b>Picture property</b> determines the name of the file, .BMP =
or .GIF, that will be displayed. It can be used for a company logo, etc.
<br><br>
<div align=3D"center"><img height=3D"300" src=3D"http://www.profsr.com/imag=
es/vb04f03.gif" width=3D"622" border=3D"0"></div><br><br>
<div align=3D"center"><a onclick=3D"return top.js.OpenExtLink(window,event,=
this)" href=3D"http://www.profsr.com/vb/vbless04.htm#Start" target=3D"_blan=
k">Top</a></div><br><br><br><br><br>
<div align=3D"center"><img height=3D"1" src=3D"http://pagead2.googlesyndica=
tion.com/pagead/imp.gif?event=3Dnoiframe&amp;client=3Dca-pub-90232639759559=
96&amp;dt=3D1140589688515&amp;lmt=3D1129335723&amp;prev_fmts=3D336x280_as&a=
mp;format=3D336x280_as&amp;output=3Dhtml&amp;url=3Dhttp%3A%2F%2Fwww.profsr.=
com%2Fvb%2Fvbless04.htm&amp;color_bg=3DFFFFFF&amp;color_text=3D000003&amp;c=
olor_link=3D003399&amp;color_url=3D000003&amp;color_border=3DFFFFFF&amp;ad_=
type=3Dtext_image&amp;ref=3Dhttp%3A%2F%2Fwww.profsr.com%2Fvb%2Fvbintro.htm&=
amp;cc=3D2050&amp;u_h=3D768&amp;u_w=3D1024&amp;u_ah=3D740&amp;u_aw=3D1024&a=
mp;u_cd=3D32&amp;u_tz=3D330&amp;u_his=3D1&amp;u_java=3Dtrue" width=3D"1" bo=
rder=3D"0">
</div><br><br><br>
<h3>TextBox</h3>
<h3>CommandButton</h3>The TextBox is like a Label but, it is used to input =
data into the program. The data typed in is in the <b>Text</b> property of =
the control. <br><br>When the program is Run, only the controls that can be=
 manipulated will be activated. For example, if the form contains 3 Labels,=
 3 TextBoxes and 3 Buttons, when it is Run, the cursor will not stop at the=
 labels.=20
<br><br>When the user hits the Tab key, the cursor will go to the first Tex=
tBox or Button - not necessarily the first one on the form but, the first o=
ne that was created. That is called the <b>Tab order</b> and you have to sp=
ecify it.=20
<br><br>On the form there is only one control at any given time that has th=
e cursor on it - it is said to have <b>Focus</b>. If you type data, the con=
trol with Focus will receive it. You change the Focus with Tab or by clicki=
ng on a different control.
<br><br>
<div align=3D"center">
<table width=3D"70%" bgcolor=3D"#ffffcc">
<colgroup>
<col>
<tbody>
<tr>
<td>Up until now we haven't bothered with the names of controls (the Name p=
roperty). Once we start to code, however, it does become important. There a=
re all kinds of occasions in code where you have to call upon a certain con=
trol. It can get very confusing when your 12 buttons are called Command1...=
Command12. What did Command7 do, again? Give each control a name (except fo=
r titles, etc. that you never refer to) so that you will be able to identif=
y it easily. It is recommended that you use a prefix when assigning a name;=
 cmd for a CommandButton, lbl for a Label, txt for a TextBox. Thus, txtNumb=
er where you input the value can be distinguished from lblNumber where you =
display the result.&nbsp;
</td></tr></tbody></colgroup></table><br><br>&nbsp;</div>The CommandButton =
is used to initiate actions, usually by clicking on it. The Caption propert=
y determines the text to display on the face of the button. The <b>Default<=
/b>
 property, if set to true, means that the button will be activated (same as=
 Clicked) if the &lt;Enter&gt; key is hit anywhere in the form. If <b>Cance=
l</b> is set to True, the button will be activated from anywhere in the for=
m by the &lt;Esc&gt; key.
<br><br>
<div align=3D"center"><img height=3D"270" src=3D"http://www.profsr.com/imag=
es/vb04f04.gif" width=3D"495" border=3D"0"></div><br><br>Hopefully, you hav=
e now run this program several times, each time you added a new control, in=
 fact. Admittedly, nothing much happened except to confirm that the control=
s were appearing in the right place on the form.
<br><br>Here now is an example of the code we could write to perform simple=
 tasks: input name and city and display the information in a label when the=
 Continue button is clicked. The Exit button will end execution of the prog=
ram and the Cancel button (or the Esc key) will clear the fields.
<br><br>
<div align=3D"center"><img height=3D"475" src=3D"http://www.profsr.com/imag=
es/vb04f05.gif" width=3D"477" border=3D"0"></div><br><br>A few explanations=
: the Form_Load event occurs when the form first opens. This is where we in=
itialize things - we want the TextBoxes and the result Label to be empty wh=
en we start off so, we set them to a blank space.=20
<br><br>The actual processing is done after the data have been entered and =
we hit the Continue button. The processing logic is put in the Continue_but=
ton_clicked event.<br><br>When you hit the &lt;Esc&gt; key or you click on =
the Cancel button, you want to annul the entry you're doing and start over =
again. That's the same as opening the form so, we just tell the program to =
execute the Form_Load procedure which we already have.
<br><br>The Exit button uses the <b>pronoun Me</b> to Unload. <b>Me</b> mea=
ns <b>the form currently active</b> without having to name it. <br><br>
<div align=3D"center"><a onclick=3D"return top.js.OpenExtLink(window,event,=
this)" href=3D"http://www.profsr.com/vb/vbless04.htm#Start" target=3D"_blan=
k">Top</a></div><br><br><br>
<div align=3D"center">
<table width=3D"70%" bgcolor=3D"#ffffcc">
<colgroup>
<col>
<tbody>
<tr>
<td>
<div align=3D"center"><b>Multiple forms</b></div><br><br>For the next serie=
s of examples we will use a new Form. It is not necessary to create a new P=
roject; any Project can have several Forms in it.<br><br>With the Project o=
pen on the current Form, go to: Menu --&gt; Project --&gt; Add form. Select=
 New form in the creation window and, voila! Next time you save the Project=
, it will ask you to name this new Form. You can name it=20
Lesson4B.frm for example.<br><br>One more detail: when you Run the Project,=
 you want to tell it which Form to open. <br><br>Go to the <b>Project Manag=
er window</b>, right click on the Project name and select <b>Project proper=
ties
</b>. In the Project properties window, the ListBox on the right says &quot=
;<b>Startup object</b>&quot;. Select the Form you want to open when you Run=
. You can change the Startup object at any time to run the different forms =
that you created.&nbsp;
</td></tr></tbody></colgroup></table></div><br><br><br><br><br><br>
<div align=3D"center"><img height=3D"1" src=3D"http://pagead2.googlesyndica=
tion.com/pagead/imp.gif?event=3Dnoiframe&amp;client=3Dca-pub-90232639759559=
96&amp;dt=3D1140589696062&amp;lmt=3D1129335723&amp;prev_fmts=3D336x280_as%2=
C336x280_as&amp;format=3D728x15_0ads_al&amp;output=3Dhtml&amp;url=3Dhttp%3A=
%2F%2Fwww.profsr.com%2Fvb%2Fvbless04.htm&amp;color_bg=3DFFFFFF&amp;color_te=
xt=3D000003&amp;color_link=3D003399&amp;color_url=3D000003&amp;color_border=
=3DFFFFFF&amp;ref=3Dhttp%3A%2F%2Fwww.profsr.com%2Fvb%2Fvbintro.htm&amp;cc=
=3D2050&amp;u_h=3D768&amp;u_w=3D1024&amp;u_ah=3D740&amp;u_aw=3D1024&amp;u_c=
d=3D32&amp;u_tz=3D330&amp;u_his=3D1&amp;u_java=3Dtrue" width=3D"1" border=
=3D"0">
</div><br><br><br>
<h3>Check boxes</h3>
<h3>Option buttons</h3>These two controls are used when the user must choos=
e from a list of options. The difference between the two is that with Check=
 boxes he can select several at one time but, with Option buttons, he must =
select only one among several.
<br><br>The example below illustrates the use of Check boxes and Option but=
tons. To capture the information entered by means of these controls, you mu=
st test the <b>property: Value.</b> In a Check box, <b>Value =3D 1 if box i=
s checked and =3D 0 if not.
</b> In an Option button, <b>Value =3D True if selected and =3D False if no=
t.</b><br><br>
<div align=3D"center"><img height=3D"438" src=3D"http://www.profsr.com/imag=
es/vb04f06.gif" width=3D"338" border=3D"0"></div><br><br>The code, although=
 somewhat long, is not very complicated. Most of the time, processing consi=
sts of checking the content of .Value. It is fairly standard procedure, esp=
ecially with Option buttons, to ensure that at least one button has been se=
lected and to display an error message if it has not.
<br><br>
<div align=3D"center"><img height=3D"263" src=3D"http://www.profsr.com/imag=
es/vb04f07.gif" width=3D"395" border=3D"0"></div><br>
<div align=3D"center"><img height=3D"366" src=3D"http://www.profsr.com/imag=
es/vb04f08.gif" width=3D"465" border=3D"0"></div><br>
<div align=3D"center"><img height=3D"377" src=3D"http://www.profsr.com/imag=
es/vb04f09.gif" width=3D"504" border=3D"0"></div><br>
<div align=3D"center"><img height=3D"404" src=3D"http://www.profsr.com/imag=
es/vb04f10.gif" width=3D"472" border=3D"0"></div><br>
<div align=3D"center"><img height=3D"150" src=3D"http://www.profsr.com/imag=
es/vb04f11.gif" width=3D"432" border=3D"0"></div><br><br><br>
<h3>Assignment 3</h3>Create the Payroll form shown below. Number of hours m=
ust be entered as well as the appropriate rate. Gross salary =3D rate * hou=
rs. Net salary =3D gross salary - deductions.<br><br>
<div align=3D"center"><img height=3D"409" src=3D"http://www.profsr.com/imag=
es/vb04f12.gif" width=3D"380" border=3D"0"></div><br><br><br><br><br>
<div align=3D"center"><img height=3D"1" src=3D"http://pagead2.googlesyndica=
tion.com/pagead/imp.gif?event=3Dnoiframe&amp;client=3Dca-pub-90232639759559=
96&amp;dt=3D1140589709562&amp;lmt=3D1129335723&amp;prev_fmts=3D336x280_as%2=
C336x280_as%2C728x15_0ads_al&amp;format=3D336x280_as&amp;output=3Dhtml&amp;=
url=3Dhttp%3A%2F%2Fwww.profsr.com%2Fvb%2Fvbless04.htm&amp;color_bg=3DFFFFFF=
&amp;color_text=3D000003&amp;color_link=3D003399&amp;color_url=3D000003&amp=
;color_border=3DFFFFFF&amp;ad_type=3Dtext_image&amp;ref=3Dhttp%3A%2F%2Fwww.=
profsr.com%2Fvb%2Fvbintro.htm&amp;cc=3D2050&amp;u_h=3D768&amp;u_w=3D1024&am=
p;u_ah=3D740&amp;u_aw=3D1024&amp;u_cd=3D32&amp;u_tz=3D330&amp;u_his=3D1&amp=
;u_java=3Dtrue" width=3D"1" border=3D"0">
 </div><br><br><br>
<div align=3D"center">
<hr width=3D"90%">
<br><br><a onclick=3D"return top.js.OpenExtLink(window,event,this)" href=3D=
"http://www.profsr.com/vb/vbless04.htm#Start" target=3D"_blank">Top</a><br>=
<br><br><br><a title=3D"Free Microsoft Access, Visual Basic training" oncli=
ck=3D"return top.js.OpenExtLink(window,event,this)" href=3D"http://www.prof=
sr.com/" target=3D"_blank">
Home</a> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;=
&nbsp;&nbsp;&nbsp;&nbsp; <a title=3D"Free tutorials Access, VB, SQL" onclic=
k=3D"return top.js.OpenExtLink(window,event,this)" href=3D"http://www.profs=
r.com/home3.html" target=3D"_blank">Tutorials</a> </div></div><span class=
=3D"ad">
<br><br></span></td></tr></tbody></table><span class=3D"ad">
<p>
<hr size=3D"1">
Jiyo cricket on <a onclick=3D"return top.js.OpenExtLink(window,event,this)"=
 href=3D"http://us.rd.yahoo.com/mail/in/mailcricket/*http://in.sports.yahoo=
.com/cricket/" target=3D"_blank">Yahoo! India cricket</a><br><a onclick=3D"=
return top.js.OpenExtLink(window,event,this)" href=3D"http://us.rd.yahoo.co=
m/mail/in/mailmobilemessenger/*http://in.mobile.yahoo.com/new/messenger/" t=
arget=3D"_blank">
Yahoo! Messenger Mobile</a> Stay in touch with your buddies all the time.=
=20
<p></p></p></span>

------=_Part_10100_16166025.1140614012703--


إنشاء مجموعة - مجموعات Google - صفحة Google الرئيسية - شروط الخدمة - سياسة الخصوصية
©2009 Google