vel21.htm
来自「简单的说明如何使用VB,非常适合初学使用者,而且是用图表来解说的」· HTM 代码 · 共 2,347 行 · 第 1/4 页
HTM
2,347 行
<TR><TD VALIGN=top BGCOLOR=#80FFFF ><FONT COLOR=#000080>DrawStyle</FONT><TD VALIGN=top BGCOLOR=#80FFFF ><FONT COLOR=#000080>Specifies the style of any graphical lines that your application draws.</FONT><TR><TD VALIGN=top BGCOLOR=#80FFFF ><FONT COLOR=#000080>DrawWidth</FONT><TD VALIGN=top BGCOLOR=#80FFFF ><FONT COLOR=#000080>Specifies the width of lines drawn, from 1 (the default) to 32767 pixels.</FONT><TR><TD VALIGN=top BGCOLOR=#80FFFF ><FONT COLOR=#000080>FillColor</FONT><TD VALIGN=top BGCOLOR=#80FFFF ><FONT COLOR=#000080>Specifies the color of printed shapes. Determines the shading density for noncolor printed output.</FONT><TR><TD VALIGN=top BGCOLOR=#80FFFF ><FONT COLOR=#000080>FillStyle</FONT><TD VALIGN=top BGCOLOR=#80FFFF ><FONT COLOR=#000080>Contains the style pattern of printed shapes.</FONT><TR><TD VALIGN=top BGCOLOR=#80FFFF ><FONT COLOR=#000080>FontBold</FONT><TD VALIGN=top BGCOLOR=#80FFFF ><FONT COLOR=#000080>Contains either True or False to determine whether subsequent printed output will be boldfaced.</FONT><TR><TD VALIGN=top BGCOLOR=#80FFFF ><FONT COLOR=#000080>FontCount</FONT><TD VALIGN=top BGCOLOR=#80FFFF ><FONT COLOR=#000080>Specifies the current printer's number of installed fonts.</FONT><TR><TD VALIGN=top BGCOLOR=#80FFFF ><FONT COLOR=#000080>FontItalic</FONT><TD VALIGN=top BGCOLOR=#80FFFF ><FONT COLOR=#000080>Holds either True or False to determine whether subsequent output will be italicized.</FONT><TR><TD VALIGN=top BGCOLOR=#80FFFF ><FONT COLOR=#000080>FontName</FONT><TD VALIGN=top BGCOLOR=#80FFFF ><FONT COLOR=#000080>Holds the name of the current font being used for output.</FONT><TR><TD VALIGN=top BGCOLOR=#80FFFF ><FONT COLOR=#000080>Fonts</FONT><TD VALIGN=top BGCOLOR=#80FFFF ><FONT COLOR=#000080>Contains a table of values that act as if they were stored in a control array. Fonts(0) to Fonts(FontCount - 1) holds the names of all installed fonts on the target computer.</FONT><TR><TD VALIGN=top BGCOLOR=#80FFFF ><FONT COLOR=#000080>FontSize</FONT><TD VALIGN=top BGCOLOR=#80FFFF ><FONT COLOR=#000080>Holds the size, in points, of the current font.</FONT><TR><TD VALIGN=top BGCOLOR=#80FFFF ><FONT COLOR=#000080>FontStrikeThru</FONT><TD VALIGN=top BGCOLOR=#80FFFF ><FONT COLOR=#000080>Holds either True or False to determine whether subsequent output will be printed with a strikethru line.</FONT><TR><TD VALIGN=top BGCOLOR=#80FFFF ><FONT COLOR=#000080>FontTransparent</FONT><TD VALIGN=top BGCOLOR=#80FFFF ><FONT COLOR=#000080>Holds either True or False to determine whether subsequent output will be transparent.</FONT><TR><TD VALIGN=top BGCOLOR=#80FFFF ><FONT COLOR=#000080>FontUnderline</FONT><TD VALIGN=top BGCOLOR=#80FFFF ><FONT COLOR=#000080>Holds either True or False to determine whether subsequent output will be underlined.</FONT><TR><TD VALIGN=top BGCOLOR=#80FFFF ><FONT COLOR=#000080>ForeColor</FONT><TD VALIGN=top BGCOLOR=#80FFFF ><FONT COLOR=#000080>Specifies the foreground color of printed text and graphics. (The paper determines the background color.)</FONT><TR><TD VALIGN=top BGCOLOR=#80FFFF ><FONT COLOR=#000080>hDC</FONT><TD VALIGN=top BGCOLOR=#80FFFF ><FONT COLOR=#000080>A Windows device context handle for advanced Windows procedure calls.</FONT><TR><TD VALIGN=top BGCOLOR=#80FFFF ><FONT COLOR=#000080>Height</FONT><TD VALIGN=top BGCOLOR=#80FFFF ><FONT COLOR=#000080>Holds the height, in twips, of the current printed page.</FONT><TR><TD VALIGN=top BGCOLOR=#80FFFF ><FONT COLOR=#000080>Page</FONT><TD VALIGN=top BGCOLOR=#80FFFF ><FONT COLOR=#000080>Contains the page number currently being printed and updated automatically by Visual Basic.</FONT><TR><TD VALIGN=top BGCOLOR=#80FFFF ><FONT COLOR=#000080>ScaleHeight</FONT><TD VALIGN=top BGCOLOR=#80FFFF ><FONT COLOR=#000080>Specifies how many ScaleMode units high that each graphic will be upon output.</FONT><TR><TD VALIGN=top BGCOLOR=#80FFFF ><FONT COLOR=#000080>ScaleLeft</FONT><TD VALIGN=top BGCOLOR=#80FFFF ><FONT COLOR=#000080>Specifies how many ScaleMode units from the left of the page where subsequent printed output appears.</FONT><TR><TD VALIGN=top BGCOLOR=#80FFFF ><FONT COLOR=#000080>ScaleMode</FONT><TD VALIGN=top BGCOLOR=#80FFFF ><FONT COLOR=#000080>Sets the unit of measurement for all subsequent printed output that appears.</FONT><TR><TD VALIGN=top BGCOLOR=#80FFFF ><FONT COLOR=#000080>ScaleTop</FONT><TD VALIGN=top BGCOLOR=#80FFFF ><FONT COLOR=#000080>Specifies how many ScaleMode units from the top of the page where all subsequent printed output appears.</FONT><TR><TD VALIGN=top BGCOLOR=#80FFFF ><FONT COLOR=#000080>ScaleWidth</FONT><TD VALIGN=top BGCOLOR=#80FFFF ><FONT COLOR=#000080>Specifies how many ScaleMode units wide that each graphic will consist of upon printed output.</FONT><TR><TD VALIGN=top BGCOLOR=#80FFFF ><FONT COLOR=#000080>TwipsPerPixelX</FONT><TD VALIGN=top BGCOLOR=#80FFFF ><FONT COLOR=#000080>Specifies the number of screen twips that each printer's dot (called a pixel) height consumes.</FONT><TR><TD VALIGN=top BGCOLOR=#80FFFF ><FONT COLOR=#000080>TwipsPerPixelY</FONT><TD VALIGN=top BGCOLOR=#80FFFF ><FONT COLOR=#000080>Specifies the number of screen twips that each printer's dot, or pixel, width consumes.</FONT><TR><TD VALIGN=top BGCOLOR=#80FFFF ><FONT COLOR=#000080>Width</FONT><TD VALIGN=top BGCOLOR=#80FFFF ><FONT COLOR=#000080>Holds the size of the page width (measured in twips).</FONT></TABLE><P>There are lots of Printer properties, as shown in Table 21.1. Luckily, you'll use only a few of the properties for most of your printing needs. The font-related Printer properties take care of just about almost all of your printing jobs that are textual in nature.<BR><BLOCKQUOTE><BLOCKQUOTE><HR ALIGN=CENTER><BR><NOTE><B>Note: </B>The graphics-related Printer properties and methods aren't covered in this unit. Once you master graphics in the next unit, you'll be more prepared to understand the graphics-related Printer properties. Most of the Printer's properties are reserved for controlling extremely advanced graphics output. For typical applications, you'll rarely bother to specify any properties because the default values work well for normal reporting requirements.</NOTE><BR><HR ALIGN=CENTER></BLOCKQUOTE></BLOCKQUOTE><P>Unlike most of Visual Basic's control objects, the Printer object's methods are much more important than the property values. Table 21.2 contains a complete list of the methods supported by Visual Basic's Printer object.<BR><BR><P ALIGN=CENTER><CENTER><FONT COLOR="#000080"><B>Table 21.2. The </B><B>Printer</B><B> object's methods.</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>Method</I></FONT><TD VALIGN=top BGCOLOR=#80FFFF ><FONT COLOR=#000080><I>Description</I></FONT><TR><TD VALIGN=top BGCOLOR=#80FFFF ><FONT COLOR=#000080>Circle</FONT><TD VALIGN=top BGCOLOR=#80FFFF ><FONT COLOR=#000080>Draws a circle, ellipse, or arc on the printer</FONT><TR><TD VALIGN=top BGCOLOR=#80FFFF ><FONT COLOR=#000080>EndDoc</FONT><TD VALIGN=top BGCOLOR=#80FFFF ><FONT COLOR=#000080>Releases the current document, in full, to the Print Manager for output</FONT><TR><TD VALIGN=top BGCOLOR=#80FFFF ><FONT COLOR=#000080>Line</FONT><TD VALIGN=top BGCOLOR=#80FFFF ><FONT COLOR=#000080>Draws lines and boxes on the page</FONT><TR><TD VALIGN=top BGCOLOR=#80FFFF ><FONT COLOR=#000080>NewPage</FONT><TD VALIGN=top BGCOLOR=#80FFFF ><FONT COLOR=#000080>Sends a page break to the printed output so that subsequent output appears on the next page</FONT><TR><TD VALIGN=top BGCOLOR=#80FFFF ><FONT COLOR=#000080>Print</FONT><TD VALIGN=top BGCOLOR=#80FFFF ><FONT COLOR=#000080>Prints numeric and text data on the printer</FONT><TR><TD VALIGN=top BGCOLOR=#80FFFF ><FONT COLOR=#000080>PSet</FONT><TD VALIGN=top BGCOLOR=#80FFFF ><FONT COLOR=#000080>Draws a graphical point on the printed output</FONT><TR><TD VALIGN=top BGCOLOR=#80FFFF ><FONT COLOR=#000080>Scale</FONT><TD VALIGN=top BGCOLOR=#80FFFF ><FONT COLOR=#000080>Determines the scale used for measuring output</FONT><TR><TD VALIGN=top BGCOLOR=#80FFFF ><FONT COLOR=#000080>TextHeight</FONT><TD VALIGN=top BGCOLOR=#80FFFF ><FONT COLOR=#000080>Determines the full height of text given in the scale set with Scale</FONT><TR><TD VALIGN=top BGCOLOR=#80FFFF ><FONT COLOR=#000080>TextWidth</FONT><TD VALIGN=top BGCOLOR=#80FFFF ><FONT COLOR=#000080>Determines the full width of text given in the scale set with Scale</FONT></TABLE><BLOCKQUOTE><BLOCKQUOTE><HR ALIGN=CENTER><BR><NOTE><B>Tip: </B>By far the most widely used Printer methods are the Print, EndDoc, and NewPage methods. Once you master these three methods, you'll rarely need to use any other methods.</NOTE><BR><HR ALIGN=CENTER></BLOCKQUOTE></BLOCKQUOTE><P><FONT COLOR="#FF8000"><B><I>Review: </I></B></FONT>There are several properties and methods available for the Printer object. Unless you need to send graphics to the printer using advanced graphics capabilities, you'll need only two or three of the properties and methods to fulfill all your printing needs.<BR><BR><A NAME="E68E161"></A><H3 ALIGN=CENTER><CENTER><FONT SIZE=5 COLOR="#FF0000"><B>The </B><FONT COLOR="#FF8000"><B><I>Print </I></B></FONT><B>Method</B></FONT></CENTER></H3><BR><P><FONT COLOR="#FF8000"><B><I>Concept: </I></B></FONT>The Printer object's Print method handles almost all printed output. Print supports several different formats. With Print, you can print messages, variables, constants, and expressions on the printer.<BR><P>The Print method is, by far, the most commonly used printing method in Visual Basic. By mastering the Print method, you will have mastered the single most important printing method that you can master.<BR><BLOCKQUOTE><BLOCKQUOTE><HR ALIGN=CENTER><BR><NOTE><B>Note: </B>Remember that a method is nothing more than a command that you apply to a particular object. For example, the AddItem method is a method that you've seen used throughout this book to add items to list and combo box controls.</NOTE><BR><HR ALIGN=CENTER></BLOCKQUOTE></BLOCKQUOTE><P>Here is the format of the Print method:<BR><BR><PRE><FONT COLOR="#000080">[Printer.]Print [Spc(<I>n</I>) | Tab(<I>n</I>)] <I>Expression</I> [; | ,]</FONT></PRE><P>The format makes Print look a lot more confusing that it really is, but the portion of the Print method that appears to the right of Print takes some explanation. The next several sections explain the various options available for the Print method.<BR><BR><A NAME="E69E144"></A><H4 ALIGN=CENTER><CENTER><FONT SIZE=4 COLOR="#FF0000"><B>Printing Constants</B></FONT></CENTER></H4><BR>
⌨️ 快捷键说明
复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?