velans.htm
来自「简单的说明如何使用VB,非常适合初学使用者,而且是用图表来解说的」· HTM 代码 · 共 3,096 行 · 第 1/3 页
HTM
3,096 行
<HTML><HEAD><TITLE>Visual Basic in 12 Easy Lessons velans.htm </TITLE><LINK REL="ToC" HREF="index.htm"><LINK REL="Index" HREF="htindex.htm"><LINK REL="Previous" HREF="velxb.htm"></HEAD><BODY BGCOLOR="#FFFFFF" TEXT="#000000" LINK="#0000FF" VLINK="#800080"><A NAME="I0"></A><H2>Visual Basic in 12 Easy Lessons velans.htm</H2><P ALIGN=LEFT><A HREF="velxb.htm" TARGET="_self"><IMG SRC="purprev.gif" WIDTH = 32 HEIGHT = 32 BORDER = 0 ALT="Previous Page"></A><A HREF="index.htm" TARGET="_self"><IMG SRC="purtoc.gif" WIDTH = 32 HEIGHT = 32 BORDER = 0 ALT="TOC"></A><HR ALIGN=CENTER><P><UL><UL><UL><LI><A HREF="#E68E186" >Lesson 1, <A HREF="vel01.htm">Unit 1</A></A><LI><A HREF="#E68E187" >Lesson 1, <A HREF="vel02.htm">Unit 2</A></A><LI><A HREF="#E68E188" >Lesson 2, <A HREF="vel03.htm">Unit 3</A></A><LI><A HREF="#E68E189" >Lesson 2, <A HREF="vel04.htm">Unit 4</A></A><LI><A HREF="#E68E190" >Lesson 3, <A HREF="vel05.htm">Unit 5</A></A><LI><A HREF="#E68E191" >Lesson 3, <A HREF="vel06.htm">Unit 6</A></A><LI><A HREF="#E68E192" >Lesson 4, <A HREF="vel07.htm">Unit 7</A></A><LI><A HREF="#E68E193" >Lesson 4, <A HREF="vel08.htm">Unit 8</A></A><LI><A HREF="#E68E194" >Lesson 5, <A HREF="vel09.htm">Unit 9</A></A><LI><A HREF="#E68E195" >Lesson 5, <A HREF="vel10.htm">Unit 10</A></A><LI><A HREF="#E68E196" >Lesson 6, <A HREF="vel11.htm">Unit 11</A></A><LI><A HREF="#E68E197" >Lesson 6, <A HREF="vel12.htm">Unit 12</A></A><LI><A HREF="#E68E198" >Lesson 7, <A HREF="vel13.htm">Unit 13</A></A><LI><A HREF="#E68E199" >Lesson 7, <A HREF="vel14.htm">Unit 14</A></A><LI><A HREF="#E68E200" >Lesson 8, <A HREF="vel15.htm">Unit 15</A></A><LI><A HREF="#E68E201" >Lesson 8, <A HREF="vel16.htm">Unit 16</A></A><LI><A HREF="#E68E202" >Lesson 9, <A HREF="vel17.htm">Unit 17</A></A><LI><A HREF="#E68E203" >Lesson 9, <A HREF="vel18.htm">Unit 18</A></A><LI><A HREF="#E68E204" >Lesson 10, <A HREF="vel19.htm">Unit 19</A></A><LI><A HREF="#E68E205" >Lesson 10, <A HREF="vel20.htm">Unit 20</A></A><LI><A HREF="#E68E206" >Lesson 10, <A HREF="vel21.htm">Unit 21</A></A><LI><A HREF="#E68E207" >Lesson 11, <A HREF="vel22.htm">Unit 22</A></A><LI><A HREF="#E68E208" >Lesson 12, Unit 23</A><LI><A HREF="#E68E209" >Lesson 12, Unit 24</A></UL></UL></UL><HR ALIGN=CENTER><A NAME="E66E39"></A><H1 ALIGN=CENTER><CENTER><FONT SIZE=6 COLOR="#FF0000"><B>Answers</B></FONT></CENTER></H1><BR><BR><A NAME="E68E186"></A><H3 ALIGN=CENTER><CENTER><FONT SIZE=5 COLOR="#FF0000"><B>Lesson 1, <A HREF="vel01.htm">Unit 1</A></B></FONT></CENTER></H3><BR><OL><LI>A program is a list of instructions that tells the computer exactly what to do.<BR><LI>Absolutely nothing. A computer is a dumb machine that cannot function without the detailed instructions of a program.<BR><LI>You can buy a program or write one yourself.<BR><LI>The programs that you write do exactly what you want them to do once you get any bugs out of them.<BR><LI>Writing your own programs takes lots of time and effort.<BR><LI>True<BR><LI>Code is a program.<BR><LI>An error that you accidentally place in the programs that you write.<BR><LI>There are syntax errors and logic errors.<BR><LI>You've just put a syntax error in the program.<BR><LI>Visual Basic finds syntax errors for you.<BR><LI>Logic errors are much harder to find than syntax errors.<BR><LI>With hardwired control panels.<BR><LI>Non-electrical people could program computers.<BR><LI>On and off states of electricity.<BR><LI>The addition of the computer keyboard introduced programming to the masses.<BR><LI>Code is the program that you and other programmers create.<BR><LI>Machine language<BR><LI>FORTRAN<BR><LI>BASIC<BR><LI>Beginner's All-purpose Symbolic Instruction Code<BR><LI>Procedural programming languages lend themselves well to text-based DOS environments.<BR><LI>Event-driven programs lend themselves well to Windows-like environments.<BR><LI>Graphical User Interface<BR><LI>Two events might be a keypress or a mouse click.<BR><LI>The user might trigger any event in any order.<BR><LI>False. Visual Basic does require some procedural-like programming for certain functions.<BR><LI>True<BR></OL><BR><A NAME="E68E187"></A><H3 ALIGN=CENTER><CENTER><FONT SIZE=5 COLOR="#FF0000"><B>Lesson 1, <A HREF="vel02.htm">Unit 2</A></B></FONT></CENTER></H3><BR><OL><LI>True<BR><LI>True<BR><LI>Add a shortcut Ctrl + Shift + V keystroke using the File Properties menu after highlighting the Visual Basic icon in the program group.<BR><LI>False<BR><LI>Select File Run, then type A:\SETUP (You can type the command in uppercase or lowercase letters).<BR><LI>The value used if you don't type a different value.<BR><LI>VBPRIMER<BR><LI>Select File Exit to exit Visual Basic and return to Windows.<BR><LI>You may lose some or all of the program you're writing.<BR><LI>The Code window, Form window, Project window, Properties window, and the Toolbox window. <BR><LI>Visual Basic uses the Form window for the application's background.<BR><LI>False<BR><LI>True. Click on the dialog control box's upper-left corner.<BR><LI>Use the access keys to more quickly execute menu commands.<BR><LI>The toolbar provides push button access to common menu commands.<BR><LI>The Visual Basic menu bar follows the same naming standard for most of its menu commands as other major Windows programs use.<BR><LI>Eleven<BR><LI>Not all menu or toolbar commands are available at all times.<BR><LI>The measurement indicators describe the size and location of elements on the Form window.<BR><LI>A twip is 1/1440th of an inch.<BR><LI>The grid provides snap-to locations that keep controls in alignment with the grid's dots when you set the appropriate Options Environment command.<BR></OL><BR><A NAME="E68E188"></A><H3 ALIGN=CENTER><CENTER><FONT SIZE=5 COLOR="#FF0000"><B>Lesson 2, <A HREF="vel03.htm">Unit 3</A></B></FONT></CENTER></H3><BR><OL><LI>You must first load the application using File Open.<BR><LI>The project file holds the application's description.<BR><LI>.MAK<BR><LI>Load the project and look in the Project window.<BR><LI>To let the user interact with and direct the program. Users click, scroll, and manage the controls as a way to respond to a program's activities.<BR><LI>The Toolbox window holds the controls that you can add to your form. (Don't you think "Control window" would be a better name?)<BR><LI>The user needs an easy way to exit a program.<BR><LI>False. The user cannot directly change text displayed in a label control.<BR><LI>The text box control.<BR><LI>You can control the font size and style of the text.<BR><LI>The user can move the text cursor forward and backward in a text box as well as use the Ins and Del keys to insert and delete text.<BR><LI>The command button control<BR><LI>False<BR><LI>True<BR><LI>The user deselects a check box by selecting the box a second time.<BR><LI>The frame control<BR><LI>True<BR><LI>True<BR><LI>False<BR><LI>True<BR><LI>The form works as the application's background and holds the controls that you place there.<BR><LI>True<BR><LI>The user can click the command button with the mouse or press the Alt+ shortcut access keystroke if the command button's label contains an underlined character. There is a third way as well (not documented in this unit): The user can press Tab until the command button is highlighted and press Enter.<BR><LI>The command button next to the combo box informs Visual Basic that there is data to be added to the list.<BR><LI>Pamela should replace the simple combo box with a dropdown combo box control.<BR></OL><BR><A NAME="E68E189"></A><H3 ALIGN=CENTER><CENTER><FONT SIZE=5 COLOR="#FF0000"><B>Lesson 2, <A HREF="vel04.htm">Unit 4</A></B></FONT></CENTER></H3><BR><OL><LI>An event might be a user keypress, mouse movement, mouse click, menu selection, or virtually anything else that a user can do to respond to a program.<BR><LI>There are too many ways for the user to interact with the visual controls on the screen. A text-based program dictates the order of the user's involvement.<BR><LI>False. Sometimes Windows captures events for its own system use.<BR><LI>Properties are attributes that differentiate the actions and behaviors of controls.<BR><LI>Event procedures<BR><LI>Here are four properties (from a huge list of many others): font size, font style, the control size, and the control color<BR><LI>True<BR><LI>True<BR><LI>The Properties window<BR><LI>The process of updating the program later.<BR><LI>The three-letter prefix describes what kind of control you're working with.<BR><LI>Users will more speedily adapt to your programs when they follow Windows standards.<BR><LI>AUTOLOAD.MAK<BR><LI>CONSTANT.TXT<BR><LI>Names given to data values that make them easier to remember.<BR><LI>False<BR><LI>Double-click the control on the Form window.<BR><LI>The first part of the event procedure is the control name, followed by an underscore, followed by the name of the event (and parentheses come after that to let you know you're working with a procedure name and not a control name).<BR><LI>Wrapper code<BR><LI>End<BR><LI>The controls and form names inside the project.<BR><LI>Usually the project and form names are the same with a .MAK and a .FRM extension respectively.<BR><LI>A form<BR><LI>A combo box<BR><LI>A command button<BR><LI>Victor, less is better! Use fewer fonts or you'll confuse the user looking at your screen.<BR><LI>A. End is a reserved word.<BR>B. Names cannot begin with a number.<BR>C. Names cannot contain special characters such as a dollar sign.<BR>D. Names cannot contain hyphens.<BR></OL><BR><A NAME="E68E190"></A><H3 ALIGN=CENTER><CENTER><FONT SIZE=5 COLOR="#FF0000"><B>Lesson 3, <A HREF="vel05.htm">Unit 5</A></B></FONT></CENTER></H3><BR><OL><LI>The control that has Window’s current attention. You can tell which one it is by the highlighting.<BR><LI>The order in which the controls receive the focus as the user presses the Tab key.<BR><LI>TabIndex<BR><LI>The Name property.<BR><LI>False<BR><LI>True<BR><LI>CONSTANT.TXT<BR><LI>An icon is a picture.<BR><LI>A point is 1/72nd of an inch.<BR><LI>A selection of colors from which you can choose.<BR><LI>D. All of the above.<BR><LI>Enabled.<BR><LI>0, 1, or 2 representing left-justified, centered, or right-justified.<BR><LI>False; rarely will you have to set or change more than a few properties because the default values are so common for many of the properties.<BR><LI>A carriage return character sends the text cursor to the next line on the screen.<BR><LI>Dynamic Data Exchange.<BR><LI>True due to the Visible property.<BR><LI>Left, Right, Top, Width.<BR><LI>The label control.<BR><LI>The PasswordChar property.<BR><LI>The Cancel property.<BR><LI>Use the control dropdown selection box.<BR></OL><BR><A NAME="E68E191"></A><H3 ALIGN=CENTER><CENTER><FONT SIZE=5 COLOR="#FF0000"><B>Lesson 3, <A HREF="vel06.htm">Unit 6</A></B></FONT></CENTER></H3><BR><OL><LI>Yes, the form is an object as is the other controls.<BR><LI>False, label controls have no <U>MultiLine</U> property.<BR><LI>A pixel is the smallest screen element available.<BR><LI>The <U>WindowState</U> property.<BR><LI>Chopping off part of text.<BR><LI>False<BR><LI>False, text box controls can have scroll bars.<BR><LI>Set the AutoSize property to False.<BR><LI>False.<BR><LI>False.<BR><LI>The TabIndex property controls the focus order.<BR><LI>The Load event.<BR><LI>The Load event occurs before the Activate event occurs.<BR><LI>The Code window contains a Proc dropdown list box that contains all the events for any given object.<BR><LI>Labels can never receive the focus.<BR><LI>The name of the event procedure must be txtLastName_Change().<BR><LI>The KeyPreview property determines whether the form or control gets the keystrokes.<BR><LI>The Caption property.<BR><LI>Add the access key to a label that describes the text box contents. Make sure that the TabIndex of the label is sequentially one less than the TabIndex of the text box.<BR><LI>The labels could hide too many other form objects.<BR><LI>The label would automatically expand horizontally before you have a chance to set the WordWrap property.<BR></OL><BR><A NAME="E68E192"></A><H3 ALIGN=CENTER><CENTER><FONT SIZE=5 COLOR="#FF0000"><B>Lesson 4, <A HREF="vel07.htm">Unit 7</A></B></FONT></CENTER></H3><BR><OL><LI>A named storage location in memory.<BR><LI>The Dim statement.<BR><LI>A data type is a category of data that all Visual Basic values fall into.<BR><LI>Integer, Long, Single, Double, Currency, Variant, String<BR><LI>Integer<BR><LI>Double<BR><LI>Single, Double, and Currency<BR><LI>E means Exponent.<BR><LI>Scientific notation provides a shortcut notation for a wide range of numeric values.<BR><LI>False<BR><LI>True; variables can change but they do not have to.<BR><LI>You'll help eliminate bugs that can occur when you misspell a variable name.<BR><LI>A fixed-length string can only accept a preset number of characters while variable-length strings can accept strings of changing-length as a program runs.<BR><LI>True<BR><LI>True<BR><LI>A. 7<BR>B. 9<BR>C. 16<BR>D. (parentheses would be required around the addition to compute a true average)<BR>E. 6<BR>F. 40<BR><LI>Merge the strings together<BR><LI>+ is used for either addition or string concatenation (depending on the context of its use) and & is used strictly for concatenation.<BR><LI>Dim SqFoot As Single<BR><LI>SalesPrice = Price / Discount<BR>Tax = TaxRate * SalesPrice<BR><LI>Name is a reserved word and cannot be a variable name.<BR><LI>Judy cannot define more than one variable with the same name. There is an advanced exception to this rule that you'll learn in Lesson 7.<BR><LI>Larry cannot use a dollar sign or commas in constant values.<BR></OL><BR><A NAME="E68E193"></A><H3 ALIGN=CENTER><CENTER><FONT SIZE=5 COLOR="#FF0000"><B>Lesson 4, <A HREF="vel08.htm">Unit 8</A></B></FONT></CENTER></H3><BR><OL><LI>A condition is a relation that you can check for in your program.<BR><LI>False, conditional tests produce one of two results, true and false<BR><LI>False but the parentheses help clarify the code<BR><LI><, >, <=, >=, =, <><BR><LI>A. False
⌨️ 快捷键说明
复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?