vel05.htm

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

HTM
2,465
字号
</TABLE><BLOCKQUOTE><BLOCKQUOTE><HR ALIGN=CENTER><BR><NOTE><I>Definition: DDE</I> stands for <I>D</I>ynamic<I> D</I>ata<I> E</I>xchange.</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>LinkItem</FONT><TD VALIGN=top  BGCOLOR=#80FFFF ><FONT COLOR=#000080>Contains the data to be passed to an advanced DDE application.</FONT></TABLE><TABLE  BORDERCOLOR=#000040 BORDER=1 CELLSPACING=2 WIDTH="100%" CELLPADDING=2 ><TR><TD VALIGN=top  BGCOLOR=#80FFFF ><FONT COLOR=#000080>LinkMode</FONT><TD VALIGN=top  BGCOLOR=#80FFFF ><FONT COLOR=#000080>Set to 0 (the default) for no DDE allowance, 1 for automatic DDE allowance, 2 for a code-based DDE, or 3 for a code-based notify requirement.</FONT><TR><TD VALIGN=top  BGCOLOR=#80FFFF ><FONT COLOR=#000080>LinkTimeout</FONT><TD VALIGN=top  BGCOLOR=#80FFFF ><FONT COLOR=#000080>The count of tenths of seconds that a sent DDE message is to wait for a response.</FONT><TR><TD VALIGN=top  BGCOLOR=#80FFFF ><FONT COLOR=#000080>LinkTopic</FONT><TD VALIGN=top  BGCOLOR=#80FFFF ><FONT COLOR=#000080>Specifies the source application and topic for a DDE application.</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 label control. 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 Label1, Label2, and so on, as you add subsequent label controls 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 value of the TabIndex of the control. No two controls on the same form can have the same TabIndex value.</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 identifying comments applied to the label control.</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 label control 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 label control.</FONT><TR><TD VALIGN=top  BGCOLOR=#80FFFF ><FONT COLOR=#000080>Width</FONT><TD VALIGN=top  BGCOLOR=#80FFFF ><FONT COLOR=#000080>The width of the label control in twips.</FONT><TR><TD VALIGN=top  BGCOLOR=#80FFFF ><FONT COLOR=#000080>WordWrap</FONT><TD VALIGN=top  BGCOLOR=#80FFFF ><FONT COLOR=#000080>If True, the text wraps to hold the entire caption. If False (the default), the text does not wrap but is truncated to fit the caption.</FONT></TABLE><BLOCKQUOTE><BLOCKQUOTE><HR ALIGN=CENTER><BR><NOTE><B>Warning: </B>Table 5.2 lists only those label properties that you can initialize and change in the Properties window. Other label properties that you can change using Visual Basic code are available only at runtime.</NOTE><BR><HR ALIGN=CENTER></BLOCKQUOTE></BLOCKQUOTE><P>Rarely, and more probably never, will you have to specify every property value when you create a new control. Most of the default values work well without any modification.<BR><P><FONT COLOR="#FF8000"><B><I>Review: </I></B></FONT>The label properties display text on the form that the user can read.<BR><BR><A NAME="E68E44"></A><H3 ALIGN=CENTER><CENTER><FONT SIZE=5 COLOR="#FF0000"><B>Text Box Controls</B></FONT></CENTER></H3><BR><P><FONT COLOR="#FF8000"><B><I>Concept: </I></B></FONT>Text box controls display default values and accept user input. Text box controls enable you to determine how the user enters data and responds to questions and controls that you display.<BR><P>When you display a text box on a form, you give the user a chance to accept a default value&#151;the text box's initial Text property&#151;or to change it to something else. The user can enter text of any data type&#151;numbers, letters, and special characters. He can scroll left and right by using the arrow keys, and he can use the Ins and Del keys to insert and delete text within the text box control.<BR><P>Most of the text box's properties work like the label control's properties. Unlike the label, however, the text box properties describe data-entry properties so that the control can deal with user input instead of simple text display. Table 5.3 describes the property values for the text box control.<BR><BR><P ALIGN=CENTER><CENTER><FONT COLOR="#000080"><B>Table 5.3. Text box 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 text box. If MultiLine contains False, Visual Basic ignores the Alignment setting.</FONT><TR><TD VALIGN=top  BGCOLOR=#80FFFF ><FONT COLOR=#000080>BackColor</FONT><TD VALIGN=top  BGCOLOR=#80FFFF ><FONT COLOR=#000080>The background color of the text box. 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><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>DragIcon</FONT><TD VALIGN=top  BGCOLOR=#80FFFF ><FONT COLOR=#000080>The icon that appears when the user drags the text box around on the form.</FONT></TABLE><BLOCKQUOTE><BLOCKQUOTE><HR ALIGN=CENTER><BR><NOTE>Because you only rarely enable the user to move a text box, 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 text box, 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 text box 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 Text 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 Text displays in italicized characters.</FONT><TR><TD VALIGN=top  BGCOLOR=#80FFFF ><FONT COLOR=#000080>FontName</FONT><TD VALIGN=top  BGCOLOR=#80FFFF ><FONT COLOR=#000080>The name of the text box'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 text box control's Text value.</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 text value 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 text value 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 Text property.</FONT><TR><TD VALIGN=top  BGCOLOR=#80FFFF ><FONT COLOR=#000080>Height</FONT><TD VALIGN=top  BGCOLOR=#80FFFF ><FONT COLOR=#000080>The height of the text box 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>HideSelection</FONT><TD VALIGN=top  BGCOLOR=#80FFFF ><FONT COLOR=#000080>Keeps text highlighted even when the text box loses its focus.</FONT><TR><TD VALIGN=top  BGCOLOR=#80FFFF ><FONT COLOR=#000080>Index</FONT><TD VALIGN=top  BGCOLOR=#80FFFF ><FONT COLOR=#000080>If the text box is part of a control array, the Index property provides the numeric subscript for each particular text box. (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 text box.</FONT><TR><TD VALIGN=top  BGCOLOR=#80FFFF ><FONT COLOR=#000080>LinkItem</FONT><TD VALIGN=top  BGCOLOR=#80FFFF ><FONT COLOR=#000080>Contains the data to be passed to an advanced DDE application.</FONT><TR><TD VALIGN=top  BGCOLOR=#80FFFF ><FONT COLOR=#000080>LinkMode</FONT><TD VALIGN=top  BGCOLOR=#80FFFF ><FONT COLOR=#000080>Set to 0 (the default) for no DDE allowance, 1 for automatic DDE allowance, 2 for a code-based DDE, or 3 for a code-based notify requirement.</FONT><TR><TD VALIGN=top  BGCOLOR=#80FFFF ><FONT COLOR=#000080>LinkTimeout</FONT><TD VALIGN=top  BGCOLOR=#80FFFF ><FONT COLOR=#000080>The count of tenths of seconds that a sent DDE message is to wait for a response.</FONT><TR><TD VALIGN=top  BGCOLOR=#80FFFF ><FONT COLOR=#000080>LinkTopic</FONT><TD VALIGN=top  BGCOLOR=#80FFFF ><FONT COLOR=#000080>Specifies the source application and topic for a DDE application.</FONT><TR><TD VALIGN=top  BGCOLOR=#80FFFF ><FONT COLOR=#000080>MaxLength</FONT><TD VALIGN=top  BGCOLOR=#80FFFF ><FONT COLOR=#000080>If set to 0 (the default), the limit of the Text value can be as great as approximately 32,000 characters. Otherwise, the MaxLength specifies how many characters the user can enter in the text box.</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 text box. The possible values range from 0 to 12 and represent the different shapes that the mouse cursor can take on. (See Lesson 12.)</FONT></TABLE><BLOCKQUOTE><BLOCKQUOTE><HR ALIGN=CENTER><BR><NOTE><I>Definition: </I>A <I>carriage return</I> character sends the text cursor to the next line.</NOTE>

⌨️ 快捷键说明

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