vel05.htm

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

HTM
2,465
字号
BGCOLOR=#80FFFF ><FONT COLOR=#000080>FontUnderline</FONT><TD VALIGN=top  BGCOLOR=#80FFFF ><FONT COLOR=#000080>If True (the default), the caption displays in underlined letters.</FONT><TR><TD VALIGN=top  BGCOLOR=#80FFFF ><FONT COLOR=#000080>Height</FONT><TD VALIGN=top  BGCOLOR=#80FFFF ><FONT COLOR=#000080>The height of the command button in twips.</FONT><TR><TD VALIGN=top  BGCOLOR=#80FFFF ><FONT COLOR=#000080>HelpContextID</FONT><TD VALIGN=top  BGCOLOR=#80FFFF ><FONT COLOR=#000080>If you add advanced context-sensitive help to your application, the HelpContextID provides the identifying number for the help text.</FONT><TR><TD VALIGN=top  BGCOLOR=#80FFFF ><FONT COLOR=#000080>Index</FONT><TD VALIGN=top  BGCOLOR=#80FFFF ><FONT COLOR=#000080>If the command button is part of a control array, the Index property provides the numeric subscript for each particular command button. (See Lesson 6.)</FONT><TR><TD VALIGN=top  BGCOLOR=#80FFFF ><FONT COLOR=#000080>Left</FONT><TD VALIGN=top  BGCOLOR=#80FFFF ><FONT COLOR=#000080>The number of twips from the left edge of the Form window to the left edge of the command button.</FONT><TR><TD VALIGN=top  BGCOLOR=#80FFFF ><FONT COLOR=#000080>MousePointer</FONT><TD VALIGN=top  BGCOLOR=#80FFFF ><FONT COLOR=#000080>The shape to which the mouse cursor changes if the user moves the mouse cursor over the command button. The possible values range from 0 to 12 and represent the different shapes that the mouse cursor can take on. (See Lesson 12.)</FONT><TR><TD VALIGN=top  BGCOLOR=#80FFFF ><FONT COLOR=#000080>Name</FONT><TD VALIGN=top  BGCOLOR=#80FFFF ><FONT COLOR=#000080>The name of the control. By default, Visual Basic generates the names Command1, Command2, and so on, as you add subsequent command buttons to the form.</FONT><TR><TD VALIGN=top  BGCOLOR=#80FFFF ><FONT COLOR=#000080>TabIndex</FONT><TD VALIGN=top  BGCOLOR=#80FFFF ><FONT COLOR=#000080>The focus tab order begins at 0 and increments every time you add a new control. You can change the focus order by changing the TabIndex values of the controls. No two controls on the same form can have the same TabIndex value.</FONT><TR><TD VALIGN=top  BGCOLOR=#80FFFF ><FONT COLOR=#000080>TabStop</FONT><TD VALIGN=top  BGCOLOR=#80FFFF ><FONT COLOR=#000080>If True, the user can press Tab to move the focus to this command button. If False, the command button cannot receive the focus.</FONT><TR><TD VALIGN=top  BGCOLOR=#80FFFF ><FONT COLOR=#000080>Tag</FONT><TD VALIGN=top  BGCOLOR=#80FFFF ><FONT COLOR=#000080>Not used by Visual Basic. The programmer can use it for an identifying comments applied to the command button.</FONT><TR><TD VALIGN=top  BGCOLOR=#80FFFF ><FONT COLOR=#000080>Top</FONT><TD VALIGN=top  BGCOLOR=#80FFFF ><FONT COLOR=#000080>The number of twips from the top edge of a command button to the top of the form.</FONT><TR><TD VALIGN=top  BGCOLOR=#80FFFF ><FONT COLOR=#000080>Visible</FONT><TD VALIGN=top  BGCOLOR=#80FFFF ><FONT COLOR=#000080>True or False, indicating whether the user can see and, therefore, use the command button.</FONT><TR><TD VALIGN=top  BGCOLOR=#80FFFF ><FONT COLOR=#000080>Width</FONT><TD VALIGN=top  BGCOLOR=#80FFFF ><FONT COLOR=#000080>The width of the command button in twips.</FONT></TABLE><BLOCKQUOTE><BLOCKQUOTE><HR ALIGN=CENTER><BR><NOTE><B>Warning: </B>Table 5.1 lists only those command button properties that you can initialize and change in the Properties window. Other command button properties that you can change using Visual Basic code are available only at runtime.</NOTE><BR><HR ALIGN=CENTER></BLOCKQUOTE></BLOCKQUOTE><P><FONT COLOR="#FF8000"><B><I>Review: </I></B></FONT>There are many command button properties. As you can see from Table 5.1, learning which properties are available tells you a lot about what you can do with command buttons later.<BR><BR><A NAME="E68E43"></A><H3 ALIGN=CENTER><CENTER><FONT SIZE=5 COLOR="#FF0000"><B>Label Properties</B></FONT></CENTER></H3><BR><P><FONT COLOR="#FF8000"><B><I>Concept: </I></B></FONT>The label holds text on the form. Although there are several ways to display text, the label control enables you to post messages on the form that you can change by means of Visual Basic code. The user, however, cannot change the value of a text control.<BR><P>Label controls are vital to Visual Basic applications because you are always putting text on the form for the user to read. Here are some of the uses for the label control:<BR><UL><UL><P>Titles (boxed and unboxed)<BR></UL></UL><UL><UL><P>Data descriptions<BR></UL></UL><UL><UL><P>Color warning messages<BR></UL></UL><UL><UL><P>Graphic descriptions<BR></UL></UL><UL><UL><P>Instructions<BR></UL></UL><P>Labels are extremely easy to place and initialize. If you don't want a message to appear in a label when the user first starts the application, be sure to delete all the text from the label's Caption property. Table 5.2 lists the properties available for labels within the Properties window.<BR><BLOCKQUOTE><BLOCKQUOTE><HR ALIGN=CENTER><BR><NOTE><B>Tip: </B>Notice that many of the properties in Table 5.2 match those in Table 5.1. Many properties, such as Width and Height, apply to several different controls. Other properties, such as AutoSize, apply to only a few controls.</NOTE><BR><HR ALIGN=CENTER></BLOCKQUOTE></BLOCKQUOTE><BR><P ALIGN=CENTER><CENTER><FONT COLOR="#000080"><B>Table 5.2. label properties.</B></FONT></CENTER><BR><TABLE  BORDERCOLOR=#000040 BORDER=1 CELLSPACING=2 WIDTH="100%" CELLPADDING=2 ><TR><TD VALIGN=top  BGCOLOR=#80FFFF ><FONT COLOR=#000080><I>Property</I></FONT><TD VALIGN=top  BGCOLOR=#80FFFF ><FONT COLOR=#000080><I>Description</I></FONT><TR><TD VALIGN=top  BGCOLOR=#80FFFF ><FONT COLOR=#000080>Alignment</FONT><TD VALIGN=top  BGCOLOR=#80FFFF ><FONT COLOR=#000080>Set to 0 for left-justification (the default), 1 for right-justification, or 2 for centering the Caption within the label. Putting a border around the label or shading the label a color often makes the justification stand out.</FONT><TR><TD VALIGN=top  BGCOLOR=#80FFFF ><FONT COLOR=#000080>AutoSize</FONT><TD VALIGN=top  BGCOLOR=#80FFFF ><FONT COLOR=#000080>If True, the control automatically adjusts its own size to shrinkwrap around the contents of its caption. If False (the default), the control clips off the right of the text if the label is not large enough to hold the entire caption.</FONT></TABLE><BLOCKQUOTE><BLOCKQUOTE><HR ALIGN=CENTER><BR><NOTE><I>Definition: </I>A <I>hexadecimal number</I> is a base-16 number.</NOTE><BR><HR ALIGN=CENTER></BLOCKQUOTE></BLOCKQUOTE><TABLE  BORDERCOLOR=#000040 BORDER=1 CELLSPACING=2 WIDTH="100%" CELLPADDING=2 ><TR><TD VALIGN=top  BGCOLOR=#80FFFF ><FONT COLOR=#000080>BackColor</FONT><TD VALIGN=top  BGCOLOR=#80FFFF ><FONT COLOR=#000080>The background color of the label. It is a hexadecimal number that represents one of thousands of possible Windows color values. You can select from a palette of colors displayed by Visual Basic when you are ready to set the BackColor property. The default background color is the same as the form's default background color.</FONT></TABLE><TABLE  BORDERCOLOR=#000040 BORDER=1 CELLSPACING=2 WIDTH="100%" CELLPADDING=2 ><TR><TD VALIGN=top  BGCOLOR=#80FFFF ><FONT COLOR=#000080>BackStyle</FONT><TD VALIGN=top  BGCOLOR=#80FFFF ><FONT COLOR=#000080>If set to 0, meaning transparent, the form&#146;s background color comes through the label&#146;s background. If set to 1 (the default), the label's background color hides the form behind the label.</FONT><TR><TD VALIGN=top  BGCOLOR=#80FFFF ><FONT COLOR=#000080>BorderStyle</FONT><TD VALIGN=top  BGCOLOR=#80FFFF ><FONT COLOR=#000080>Either 0 (the default) for no border or 1 for a fixed single-line border.</FONT><TR><TD VALIGN=top  BGCOLOR=#80FFFF ><FONT COLOR=#000080>Caption</FONT><TD VALIGN=top  BGCOLOR=#80FFFF ><FONT COLOR=#000080>The text that appears on a label.</FONT><TR><TD VALIGN=top  BGCOLOR=#80FFFF ><FONT COLOR=#000080>DragIcon</FONT><TD VALIGN=top  BGCOLOR=#80FFFF ><FONT COLOR=#000080>The icon that appears when the user drags the label control around on the form.</FONT></TABLE><BLOCKQUOTE><BLOCKQUOTE><HR ALIGN=CENTER><BR><NOTE>Because you only rarely enable the to user move a label control, you won&#146;t use the Drag... property settings very much.</NOTE><BR><HR ALIGN=CENTER></BLOCKQUOTE></BLOCKQUOTE><TABLE  BORDERCOLOR=#000040 BORDER=1 CELLSPACING=2 WIDTH="100%" CELLPADDING=2 ><TR><TD VALIGN=top  BGCOLOR=#80FFFF ><FONT COLOR=#000080>DragMode</FONT><TD VALIGN=top  BGCOLOR=#80FFFF ><FONT COLOR=#000080>Contains either 1 for manual mouse dragging requirements&#151;the user can press and hold the mouse button while dragging the control&#151;or 0 (the default) for automatic mouse dragging&#151;the user cannot drag the label control, but through code you can initiate the dragging if needed.</FONT></TABLE><TABLE  BORDERCOLOR=#000040 BORDER=1 CELLSPACING=2 WIDTH="100%" CELLPADDING=2 ><TR><TD VALIGN=top  BGCOLOR=#80FFFF ><FONT COLOR=#000080>Enabled</FONT><TD VALIGN=top  BGCOLOR=#80FFFF ><FONT COLOR=#000080>If True (the default), the label control can respond to events. Otherwise, Visual Basic halts event processing for that particular control.</FONT><TR><TD VALIGN=top  BGCOLOR=#80FFFF ><FONT COLOR=#000080>FontBold</FONT><TD VALIGN=top  BGCOLOR=#80FFFF ><FONT COLOR=#000080>If True (the default), the Caption displays in boldfaced characters.</FONT><TR><TD VALIGN=top  BGCOLOR=#80FFFF ><FONT COLOR=#000080>FontItalic</FONT><TD VALIGN=top  BGCOLOR=#80FFFF ><FONT COLOR=#000080>If True (the default), the caption displays in italicized character.</FONT><TR><TD VALIGN=top  BGCOLOR=#80FFFF ><FONT COLOR=#000080>FontName</FONT><TD VALIGN=top  BGCOLOR=#80FFFF ><FONT COLOR=#000080>The name of the label control&#146;s style. You typically use the name of a Windows True Type font.</FONT><TR><TD VALIGN=top  BGCOLOR=#80FFFF ><FONT COLOR=#000080>FontSize</FONT><TD VALIGN=top  BGCOLOR=#80FFFF ><FONT COLOR=#000080>The size, in points, of the font used for the label control's caption.</FONT><TR><TD VALIGN=top  BGCOLOR=#80FFFF ><FONT COLOR=#000080>FontStrikethru</FONT><TD VALIGN=top  BGCOLOR=#80FFFF ><FONT COLOR=#000080>If True (the default), the caption displays in strikethrough letters. In other words, the characters have a line drawn through them.</FONT><TR><TD VALIGN=top  BGCOLOR=#80FFFF ><FONT COLOR=#000080>FontUnderline</FONT><TD VALIGN=top  BGCOLOR=#80FFFF ><FONT COLOR=#000080>If True (the default), the caption displays in underlined letters.</FONT><TR><TD VALIGN=top  BGCOLOR=#80FFFF ><FONT COLOR=#000080>ForeColor</FONT><TD VALIGN=top  BGCOLOR=#80FFFF ><FONT COLOR=#000080>The color of the text inside the caption.</FONT><TR><TD VALIGN=top  BGCOLOR=#80FFFF ><FONT COLOR=#000080>Height</FONT><TD VALIGN=top  BGCOLOR=#80FFFF ><FONT COLOR=#000080>The height of the label control in twips.</FONT><TR><TD VALIGN=top  BGCOLOR=#80FFFF ><FONT COLOR=#000080>Index</FONT><TD VALIGN=top  BGCOLOR=#80FFFF ><FONT COLOR=#000080>If the label control is part of a control array, the Index property provides the numeric subscript for each particular label control. (See Lesson 6.)</FONT><TR><TD VALIGN=top  BGCOLOR=#80FFFF ><FONT COLOR=#000080>Left</FONT><TD VALIGN=top  BGCOLOR=#80FFFF ><FONT COLOR=#000080>The number of twips from the left edge of the Form window to the left edge of the label control.</FONT>

⌨️ 快捷键说明

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