velp02.htm

来自「简单的说明如何使用VB,非常适合初学使用者,而且是用图表来解说的」· HTM 代码 · 共 267 行

HTM
267
字号
<HTML><HEAD><TITLE>Visual Basic in 12 Easy Lessons velp02.htm </TITLE><LINK REL="ToC" HREF="index.htm"><LINK REL="Index" HREF="htindex.htm"><LINK REL="Next" HREF="vel05.htm"><LINK REL="Previous" HREF="vel04.htm"></HEAD><BODY BGCOLOR="#FFFFFF" TEXT="#000000" LINK="#0000FF" VLINK="#800080"><A NAME="I0"></A><H2>Visual Basic in 12 Easy Lessons velp02.htm</H2><P ALIGN=LEFT><A HREF="vel04.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><A HREF="vel05.htm" TARGET="_self"><IMG SRC="purnext.gif" WIDTH = 32 HEIGHT = 32 BORDER = 0 ALT="Next Page"></A><HR ALIGN=CENTER><P><UL><UL><UL><LI><A HREF="#E68E39" >Stop &amp; Type</A><UL><LI><A HREF="#E69E35" >The Program's Description</A><LI><A HREF="#E69E36" >The Program's Action</A><LI><A HREF="#E69E37" >That's It for Now</A></UL></UL></UL></UL><HR ALIGN=CENTER><A NAME="E66E6"></A><H1 ALIGN=CENTER><CENTER><FONT SIZE=6 COLOR="#FF0000"><B>Project 2</B></FONT></CENTER></H1><BR><A NAME="E67E9"></A><H2 ALIGN=CENTER><CENTER><FONT SIZE=6 COLOR="#FF0000"><B>Visual Basic Programs</B></FONT></CENTER></H2><BR><BR><A NAME="E68E39"></A><H3 ALIGN=CENTER><CENTER><FONT SIZE=5 COLOR="#FF0000"><B>Stop &amp; Type</B></FONT></CENTER></H3><BR><P>This lesson discussed the controls and properties of Visual Basic programs. The properties determine the look and behavior of the controls. The controls let the user interact with the program. When you write Visual Basic programs, you should follow as many standards as you can so that you can minimize any subsequent maintenance. You saw that the AUTOLOAD.MAK file determines how new projects will behave. You also learned<BR><UL><LI>To use good judgment when you design applications so that you do not use several controls that would only make the application look too busy.<BR><BR><LI>To use standard three-letter abbreviations when you name controls so that you know from its name exactly what kind of control you are working with.<BR><BR><LI>To follow Windows programming standards so that your application looks and behaves like other Windows applications. That way, the user will be familiar with your programs and will be more likely to learn and use the programs that you write.<BR><BR></UL><P>The projects at the end of each lesson in this book show the creation of a Visual Basic program. They demonstrate the concepts taught in each unit. You have only scratched the surface so far. Beginning with the next lesson, you will start learning the details of controls and properties. So far, you have seen only how to place and activate the label and command button controls. There is much more to learn about these and the other controls. For this project, focus on following the instructions to gain more insight and practice in using Visual Basic.<BR><BR><A NAME="E69E35"></A><H4 ALIGN=CENTER><CENTER><FONT SIZE=4 COLOR="#FF0000"><B>The Program's Description</B></FONT></CENTER></H4><BR><P>Figure P2.1 shows the first screen of the application described in this project. The application is simple and easy to implement if you follow the instructions that come next.<BR><P><B> <A HREF="P2vel01.gif">Figure P2.1. Getting ready to view different </B><B>properties.</A></B><BR><P>The purpose of this program is to show you the various properties that are possible for labels. Lesson 3 explores the label control's properties in detail, but you are already versed enough in Visual Basic to understand the properties demonstrated by this program.<BR><BR><A NAME="E69E36"></A><H4 ALIGN=CENTER><CENTER><FONT SIZE=4 COLOR="#FF0000"><B>The Program's Action</B></FONT></CENTER></H4><BR><P>The program first displays a label in the center of the screen. The label's border shows that the label is wide. The text in the center of the label is small, and the label's background color is white. Click the Next Property command to see a different set of properties.<BR><P>The property changed by your first command button click is the alignment. A label can be left-justified, centered, or right-justified inside its placed width. The label began as a centered label, but you now see a left-justified label.<BR><P>Click Next Property again. The label takes on the right-justified alignment property.<BR><P>Clicking the Next Property button once more returns the label to the centered alignment and changes the property's font size to a big font. As you click the Next Property button, you will see that the label updates to show you the changed property.<BR><P>To see the label's background color change, click Next Property again. The background of the label turns bright green. (Wear your sunglasses.)<BR><P>Click the Next Property command button once more to see the final label property change. As Figure P2.2 shows, the width of the label shrinks to a smaller size. When you click the Next Property command button again, the label returns to its original size, font, and color property values.<BR><P><B> <A HREF="P2vel02.gif">Figure P2.2. The width property got smaller.</A></B><BR><BLOCKQUOTE><BLOCKQUOTE><HR ALIGN=CENTER><BR><NOTE><A NAME="I2"></A><B>Note: </B>This project's application contains a command button event procedure that changes all the properties whenever the user clicks the Next Property command button. This project does not list the code for that event procedure because the code would make absolutely no sense at this point in the book. If you really want to see the code, scroll through the Code window after you start the program.</NOTE><BR><HR ALIGN=CENTER></BLOCKQUOTE></BLOCKQUOTE><BR><A NAME="E69E37"></A><H4 ALIGN=CENTER><CENTER><FONT SIZE=4 COLOR="#FF0000"><B>That's It for Now</B></FONT></CENTER></H4><BR><P>You can now exit the program by clicking the Exit command button. The application quits running, and you will return to the Visual Basic development environment.<P ALIGN=LEFT><A HREF="vel04.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="vel05.htm" TARGET="_self"><IMG SRC="purnext.gif" WIDTH = 32 HEIGHT = 32 BORDER = 0 ALT="Next Page"></A></BODY></HTML>

⌨️ 快捷键说明

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