⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 vel02.htm

📁 简单的说明如何使用VB,非常适合初学使用者,而且是用图表来解说的
💻 HTM
📖 第 1 页 / 共 3 页
字号:
</FONT><TD VALIGN=top  BGCOLOR=#80FFFF ><FONT COLOR=#000080><I>Description</I></FONT><TR><TD VALIGN=top  BGCOLOR=#80FFFF ><FONT COLOR=#000080>File</FONT><TD VALIGN=top  BGCOLOR=#80FFFF ><FONT COLOR=#000080>The File menu contains all file-related commands with which you can load and save Visual Basic applications. It also provides printing access for printed program descriptions as well as the Exit command that you learned about earlier in this unit.</FONT><TR><TD VALIGN=top  BGCOLOR=#80FFFF ><FONT COLOR=#000080>Edit</FONT><TD VALIGN=top  BGCOLOR=#80FFFF ><FONT COLOR=#000080>Programmers often use the commands on the Edit menu for copying, cutting, and pasting text and graphical controls among applications. The Edit commands also help you with the creation of your programs by supplying common search and replace actions.</FONT><TR><TD VALIGN=top  BGCOLOR=#80FFFF ><FONT COLOR=#000080>View</FONT><TD VALIGN=top  BGCOLOR=#80FFFF ><FONT COLOR=#000080>The View menu command enables you to control the viewing of your application's Code window, various routines that can appear inside the Code window, as well as the toolbar. By hiding the toolbar, you can gain a little extra screen space. For instance, if you wanted more workspace and did not use the toolbar often, you could hide the toolbar by unselecting View Toolbar (the default is selected so that the toolbar appears). The toolbar will disappear. Selecting View Toolbar once again displays the toolbar.</FONT><TR><TD VALIGN=top  BGCOLOR=#80FFFF ><FONT COLOR=#000080>Run</FONT><TD VALIGN=top  BGCOLOR=#80FFFF ><FONT COLOR=#000080>When you complete an application, you can see the results of your work with the Run menu. The Run menu enables you to execute programs, halt the execution, and resume the execution after a halt.</FONT><TR><TD VALIGN=top  BGCOLOR=#80FFFF ><FONT COLOR=#000080>Debug</FONT><TD VALIGN=top  BGCOLOR=#80FFFF ><FONT COLOR=#000080>One of the most powerful features of Visual Basic is its debugging capability. With the Debug menu, you can execute a Visual Basic program one statement at a time, looking at data values along the way, and stop the program at any point to analyze what is going on. If a program does not behave the way you think it should, the Debug menu will help you pinpoint the cause of the trouble.</FONT><TR><TD VALIGN=top  BGCOLOR=#80FFFF ><FONT COLOR=#000080>Options</FONT><TD VALIGN=top  BGCOLOR=#80FFFF ><FONT COLOR=#000080>You can determine the way in which Visual Basic behaves by modifying values within the Option menu. You can control both environment options&#151;the environment is the Visual Basic atmosphere in which you build programs&#151;and project options that determine how each particular application behaves.</FONT><TR><TD VALIGN=top  BGCOLOR=#80FFFF ><FONT COLOR=#000080>Window</FONT><TD VALIGN=top  BGCOLOR=#80FFFF ><FONT COLOR=#000080>With the Window menu, you can display the Project, Properties, and Toolbox windows as well as auxiliary areas in Visual Basic such as Visual Basic's color selection box (with which you can assign colors to various controls you place on forms), the Menu Design dialog box (which you use for adding menus to your Visual Basic applications), and the Debug window (where you can work while debugging the program).</FONT><TR><TD VALIGN=top  BGCOLOR=#80FFFF ><FONT COLOR=#000080>Help</FONT><TD VALIGN=top  BGCOLOR=#80FFFF ><FONT COLOR=#000080>When you select from the Help menu with the Primer edition of Visual Basic, you will not get online help as you would in the full version. If you select Help Contents, for example, the Visual Basic Primer displays the window shown in Figure 2.8, which describes the help system if you were to use the regularly-priced version of Visual Basic. (If you display this screen, select File Exit to get rid of it.) Some of the lower commands on the Help menu produce a message box that tells you that no help is available. You can, however, display the About box to see how much memory is available as well as the copyright notice and version of the Visual Basic Primer system.</FONT></TABLE><P><B> <A HREF="02vel08.gif">Figure 2.8. Sorry. You will get no help from the </B><B>Visual Basic Primer Edition.</A></B><BR><BR><A NAME="E69E21"></A><H4 ALIGN=CENTER><CENTER><FONT SIZE=4 COLOR="#FF0000"><B>The Shortcut Access Keys</B></FONT></CENTER></H4><BR><BLOCKQUOTE><BLOCKQUOTE><HR ALIGN=CENTER><BR><NOTE><I>Definition: </I>An <I>access keystroke</I> is a shortcut method of issuing orders.</NOTE><BR><HR ALIGN=CENTER></BLOCKQUOTE></BLOCKQUOTE><P>Many of the menu bar's commands also activate when you press an access keystroke. For example, if you display the File pull-down menu, you will see the menu shown in Figure 2.9. You can activate any command on the File menu by displaying the menu and selecting a commend. You can also issue orders for four of the commands by pressing an access keystroke.<BR><P><B> <A HREF="02vel09.gif">Figure 2.9. Access keystrokes make selecting </B><B>certain commands easier.</A></B><BR><P>Instead of selecting File Add File..., you can press Ctrl+D. Instead of selecting Save File, you can press Ctrl+S. The access keystrokes are available from within Visual Basic even if you do not first display the menu. For example, you can save the active file by pressing Ctrl+S without having to take the time to display the File menu first.<BR><BLOCKQUOTE><BLOCKQUOTE><HR ALIGN=CENTER><BR><NOTE><B>Tip: </B>The Ctrl key works just as how the Shift and Alt keys work. Pressing Ctrl+S means press and hold the Ctrl key, and then press the S key while still holding down Ctrl, and then immediately let up on both.</NOTE><BR><HR ALIGN=CENTER></BLOCKQUOTE></BLOCKQUOTE><P>Not all of the access keystrokes require that you use the Ctrl key. For example, some menu commands on the Edit pull-down menu do not require a second key such as Ctrl. Also, the Edit Find Previous command requires Shift+F3.<BR><BLOCKQUOTE><BLOCKQUOTE><HR ALIGN=CENTER><BR><NOTE><B>Tip: </B>As you will see next, many of the toolbar commands provide the same functionality as many of the menu commands.</NOTE><BR><HR ALIGN=CENTER></BLOCKQUOTE></BLOCKQUOTE><BR><A NAME="E69E22"></A><H4 ALIGN=CENTER><CENTER><FONT SIZE=4 COLOR="#FF0000"><B>The Toolbar: Push Button Swiftness</B></FONT></CENTER></H4><BR><P>Figure 2.10 shows the toolbar and describes each button on the toolbar. Many of the toolbar buttons represent menu commands. Instead of issuing a menu command by using the mouse or an access key, you can point to a toolbar button to perform the same task.<BR><P><B> <A HREF="02vel10.gif">Figure 2.10. The toolbar contains quick access to </B><B>many commands.</A></B><BR><P>As you progress through this book and learn how to use commands that appear on the toolbar, you will be reminded when you can use a toolbar button. Some people prefer not to use the toolbar. They either want more screen space or do not think the icons are that easy to remember&#151;they are <I>not</I> easy to remember. Remember that the View Toolbar command hides the toolbar from view if you do not want to see the toolbar.<BR><BLOCKQUOTE><BLOCKQUOTE><HR ALIGN=CENTER><BR><NOTE><B>Warning: </B>Before you remove the toolbar, be sure that you do not need the measurement indicators that appear to the right of the toolbar. The next section explains what the measurement indicators do.</NOTE><BR><HR ALIGN=CENTER></BLOCKQUOTE></BLOCKQUOTE><P>Notice that not all of the toolbar buttons are dark. Some are grayed out, just as some of the pull-down menu bar commands are grayed out at times. Visual Basic knows that certain commands have to be activated at specific times within the program. If you have not copied text or a control to the clipboard, for example, you cannot use the Edit Paste command.<BR><BR><A NAME="E69E23"></A><H4 ALIGN=CENTER><CENTER><FONT SIZE=4 COLOR="#FF0000"><B>The Measurement Indicators</B></FONT></CENTER></H4><BR><P>As you draw and resize images on the Form window, you will often look to the two measurement indicators that appear to the right of the toolbar for help. The first indicator describes the upper-left corner measurement of a control, and the second indicator describes the size of the control.<BR><BLOCKQUOTE><BLOCKQUOTE><HR ALIGN=CENTER><BR><NOTE><I>Definition: </I>A <I>twip</I> is 1/1440 of an inch.</NOTE><BR><HR ALIGN=CENTER></BLOCKQUOTE></BLOCKQUOTE><P>Each of the measurements appear in twips. For example, Figure 2.11 shows a box placed in the center of the Form window. You know from the measurement indicators that the box's upper-left corner appears exactly 3,000 twips from the left edge of the Form window and exactly 1,560 twips from the top edge of the Form window. Likewise, you know that the box is exactly 1,215 twips wide and 495 twips long.<BR><P><B> <A HREF="02vel11.gif">Figure 2.11. The measurement indicators enable </B><B>you to size and place controls on the Form window.</A></B><BR><P>By using the measurement indicators, you ensure that all screen elements in your user's application are aligned and properly adjusted for the size that you want.<BR><BLOCKQUOTE><BLOCKQUOTE><HR ALIGN=CENTER><BR><NOTE><B>Note: </B>The Form window's grid of dots that you see in the background helps you align images with one other. The grid is sometimes called a <I>snap to</I> grid because controls that you place on the Form window snap to the nearest grid dot location if you place controls between two grid points. If you want to adjust the distance between grid dots, use the Options Environment command. If you want to turn off the grid so that you can place controls between grid points when you want, you can set the Align To Grid option to No from the same menu location.</NOTE><BR><HR ALIGN=CENTER></BLOCKQUOTE></BLOCKQUOTE><P><FONT COLOR="#FF8000"><B><I>Review: </I></B></FONT>You have now seen a complete description of the Visual Basic screen and its environment. Although you do not know how to use all the elements in the environment, you are at least familiar with the environment and will recognize the names of the screen elements when they appear later in this book.<BR><BR><A NAME="E68E19"></A><H3 ALIGN=CENTER><CENTER><FONT SIZE=5 COLOR="#FF0000"><B>Homework</B></FONT></CENTER></H3><BR><BR><A NAME="E69E24"></A><H4 ALIGN=CENTER><CENTER><FONT SIZE=4 COLOR="#FF0000"><B>General Knowledge</B></FONT></CENTER></H4><BR><OL><LI>True or false: You can run but not compile Windows programs using the Visual Basic Primer disk.<BR><BR><LI>True or false: You must install the Visual Basic Primer application onto your hard disk.<BR><BR><LI>How can you set up a shortcut to run Visual Basic from the Program Manager without first opening the Visual Basic program group?<BR><BR><LI>True or false: If your Program Manager contains a set of program groups different from those shown in this unit, you will not be able to install Visual Basic.<BR><BR><LI>What command do you type to start the installation of this book's Visual Basic?<BR><BR><LI>What does the term <I>default</I> mean?<BR><BR><LI>What is the default name of the directory where the Visual Basic Primer installs itself?<BR><BR><LI>How can you exit Visual Basic?<BR><BR><LI>What happens if you turn off the computer before you exit Visual Basic?<BR><BR><LI>Name Visual Basic's five primary windows.<BR><BR><LI>Which window does Visual Basic use as the application's background?<BR><BR><LI>True or false: There is no difference between the toolbox and the toolbar.<BR><BR><LI>True or false: You can hide the toolbox from view.<BR><BR><LI>What are the access keys used for?<BR><BR><LI>What is the toolbar used for?<BR><BR><LI>Why is Visual Basic's menu bar familiar to most Windows users?<BR><BR><LI>How many access keystrokes are available on the Edit pull-down menu?<BR><BR><LI>Why are some of Visual Basic's menu commands and toolbar buttons grayed out at times?<BR><BR><LI>What do the toolbar's measurement indicators do?<BR><BR><LI>What is a twip?<BR><BR><LI>How does the grid help you align controls on the form?<BR><BR></OL><BR><A NAME="E69E25"></A><H4 ALIGN=CENTER><CENTER><FONT SIZE=4 COLOR="#FF0000"><B>Extra Credit</B></FONT></CENTER></H4><BR><P>Locate each toolbar button's corresponding menu command. In doing so, you will better familiarize yourself with the menu and its contents.<BR><P ALIGN=LEFT><A HREF="vel01.htm" TARGET="_self"><IMG SRC="purprev.gif" WIDTH = 32 HEIGHT = 32 BORDER = 0 ALT="Previous Page"></A><A HREF="#I0" TARGET="_self"><IMG SRC="purtop.gif" WIDTH = 32 HEIGHT = 32 BORDER = 0 ALT="Page Top"></A><A HREF="index.htm" TARGET="_self"><IMG SRC="purtoc.gif" WIDTH = 32 HEIGHT = 32 BORDER = 0 ALT="TOC"></A><A HREF="velp01.htm" TARGET="_self"><IMG SRC="purnext.gif" WIDTH = 32 HEIGHT = 32 BORDER = 0 ALT="Next Page"></A><A </BODY></HTML>

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -