تور لحظه آخری
امروز : جمعه ، 15 تیر 1403    احادیث و روایات:  امام صادق (ع):يك عالم برتر از هزار عابد و هزار زاهد است.
سرگرمی سبک زندگی سینما و تلویزیون فرهنگ و هنر پزشکی و سلامت اجتماع و خانواده تصویری دین و اندیشه ورزش اقتصادی سیاسی حوادث علم و فناوری سایتهای دانلود گوناگون شرکت ها

تبلیغات

تبلیغات متنی

اتاق فرار

خرید ووچر پرفکت مانی

تریدینگ ویو

کاشت ابرو

لمینت دندان

ونداد کولر

صرافی ارکی چنج

صرافی rkchange

دانلود سریال سووشون

دانلود فیلم

ناب مووی

رسانه حرف تو - مقایسه و اشتراک تجربه خرید

سرور اختصاصی ایران

تور دبی

دزدگیر منزل

تشریفات روناک

اجاره سند در شیراز

قیمت فنس

armanekasbokar

armanetejarat

صندوق تضمین

پیچ و مهره

طراحی کاتالوگ فوری

دانلود کتاب صوتی

تعمیرات مک بوک

Future Innovate Tech

آموزشگاه آرایشگری مردانه شفیع رسالت

پی جو مشاغل برتر شیراز

قیمت فرش

آموزش کیک پزی در تهران

لوله بازکنی تهران

میز جلو مبلی

هتل 5 ستاره شیراز

آراد برندینگ

رنگ استخری

سایبان ماشین

قالیشویی در تهران

مبل استیل

بهترین وکیل تهران

شرکت حسابداری

نظرسنجی انتخابات 1403

استعداد تحلیلی

کی شاپ

خرید دانه قهوه

دانلود رمان

وکیل کرج

آمپول بیوتین بپانتین

پرس برک

بهترین پکیج کنکور

خرید تیشرت مردانه

خرید نشادر

خرید یخچال خارجی

وکیل تبریز

اجاره سند

وام لوازم خانگی

نتایج انتخابات ریاست جمهوری

خرید سی پی ارزان

خرید ابزار دقیق

بهترین جراح بینی خانم

تاثیر رنگ لباس بر تعاملات انسانی

خرید ریبون

 






آمار وبسایت

 تعداد کل بازدیدها : 1804647869




هواشناسی

نرخ طلا سکه و  ارز

قیمت خودرو

فال حافظ

تعبیر خواب

فال انبیاء

متن قرآن



اضافه به علاقمنديها ارسال اين مطلب به دوستان آرشيو تمام مطالب
archive  refresh

دستور printformدر vb -


واضح آرشیو وب فارسی:سایت ریسک: t=39812">دستور printformدر vb Jaf@r 15 مهر 1384, 11:59سلام من در داخل يك فرم با دستور print يك سري نوشته رو چاپ كرده ام ولي وقتي از فرم با دستور printform پرينت مي گيرم در صفحه پرينت شده من چيزي نمي باشد. saalek110 15 مهر 1384, 17:13Visual Basic Concepts Printing with the Printer Object There are several ways to place text and graphics on the Printer object. To print with the Printer object, do any of the following: Assign the specific member of the Printers collection to the Printer object if you want to print to a printer other than the default printer. Put text and graphics on the Printer object. Print the contents of the Printer object with the NewPage or EndDoc method. Printer Object Properties The properties of the Printer object initially match those of the default printer set in the Windows Control Panel. At run time, you can set any of the Printer object properties, which include: PaperSize, Height, Width, Orientation, ColorMode, Duplex, TrackDefault, Zoom, DriverName, DeviceName, Port, Copies, PaperBin, and PrintQuality. For more details and syntax for these methods, see the Language Reference. If the TrackDefault property is True and you change the default printer in the Windows Control Panel, the Printer object property values will reflect the properties of the new default printer. You cannot change some properties in the middle of a page once a property has been set. Changes to these properties will only affect subsequent pages. The following statements show how you can print each page using a different print quality: For pageno = 1 To 4 Printer.PrintQuality = -1 * pageno Printer.Print "The quality of this page is"; pageno Printer.NewPage Next Print quality values can range from – 4 to – 1, or a positive integer corresponding to the print resolution in dots per inch (DPI). For example, the following code would set the printer’s resolution to 300 DPI: Printer.PrintQuality = 300 For More Information For information on the Printer object properties, see the appropriate property in the Language Reference. Note The effect of Printer property values depends on the driver supplied by the printer manufacturer. Some property settings may have no effect, or several different property settings may all have the same effect. Settings outside the accepted range may or may not produce an error. For more information on specific drivers, see the manufacturer’s documentation. Scale Properties The Printer object has these scale properties: ScaleMode ScaleLeft and ScaleTop ScaleWidth and ScaleHeight Zoom The ScaleLeft and ScaleTop properties define the x- and y-coordinates, respectively, of the upper-left corner of a printable page. By changing the values of ScaleLeft and ScaleTop, you can create left and top margins on the printed page. For example, you can use ScaleLeft and ScaleTop to center a printed form (PFrm) on the page using these statements: Printer.ScaleLeft = -((Printer.Width - PFrm.Width) / 2) Printer.ScaleTop = -((Printer.Height - PFrm.Height) _ / 2) Many printers support the Zoom property. This property defines the percentage by which output is scaled. The default value of the Zoom property is 100, indicating that output will be printed at 100 percent of its size (actual size). You can use the Zoom property to make the page you print smaller or larger than the actual paper page. For example, setting Zoom to 50 makes your printed page appear half as wide and half as long as the paper page. The following syntax sets the Zoom property to half the size of the default Printer object: Printer.Zoom = 50 Positioning Text and Graphics You can set CurrentX and CurrentY properties for the Printer object, just as you can for forms and picture boxes. With the Printer object, these properties determine where to position output on the current page. The following statements set drawing coordinates to the upper-left corner of the current page: Printer.CurrentX = 0 Printer.CurrentY = 0 You can also use the TextHeight and TextWidth methods to position text on the Printer object. For more information on using these text methods, see "Displaying Print Output at a Specific Location" earlier in this chapter. Printing Forms on the Printer Object You may want your application to print one or more forms along with information on those forms, especially if the design of the form corresponds to a printed document like an invoice or a time card. For the easiest way to do this, use the PrintForm method. For the best quality on a laser printer use the Print and graphics methods with the Printer object. Keep in mind that using the Printer object takes more planning, because you must recreate the form on the Printer object before you print. Recreating a form on the Printer object may also require recreating: The outline of the form, including title and menu bars. The controls and their contents, including text and graphics. The output of graphics methods applied directly to the form, including the Print method. The extent to which you recreate these elements on the Printer object depends on your application and how much of the form you need to print. Recreating Text and Graphics on a Form When creating text and graphics on a form using the Print, Line, Circle, PaintPicture, or PSet methods, you may also want a copy of this output to appear on the Printer object. The easiest way to accomplish this is to write a device-independent procedure to recreate the text and graphics. For example, the following procedure uses the PaintPicture method to print a form or control’s Picture property to any output object, such as a printer or another form: Sub PrintAnywhere (Src As Object, Dest As Object) Dest.PaintPicture Src.Picture, Dest.Width / 2, _ Dest.Height / 2 If Dest Is Printer Then Printer.EndDoc End If End Sub You then call this procedure and pass it the source and destination objects: PrintAnywhere MyForm, Printer PrintAnywhere MyForm, YourForm For More Information For more information, see "Print Method," "Line Method," "Circle Method," "Pset Method," or "PaintPicture Method" in the Language Reference. Printing Controls on a Form The Printer object can receive the output of the Print method and the graphics methods (such as the Line or PSet method). But you cannot place controls directly on the Printer object. If your application needs to print controls, you must either write procedures that redraw each type of control you use on the Printer object, or use the PrintForm method. Printing the Contents of the Printer Object Once you have placed text and graphics on the Printer object, use the EndDoc method to print the contents. The EndDoc method advances the page and sends all pending output to the spooler. A spooler intercepts a print job on its way to the printer and sends it to disk or memory, where the print job is held until the printer is ready for it. For example: Printer.Print "This is the first line of text in _ a pair." Printer.Print "This is the second line of text in _ a pair." Printer.EndDoc Note Visual Basic automatically calls EndDoc if your application ends without explicitly calling it. Creating Multiple-Page Documents When printing longer documents, you can specify in code where you want a new page to begin by using the NewPage method. For example: Printer.Print "This is page 1." Printer.NewPage Printer.Print "This is page 2." Printer.EndDoc Canceling a Print Job You can terminate the current print job by using the KillDoc method. For example, you can query the user with a dialog box to determine whether to print or terminate a document: Sub PrintOrNot() Printer.Print "This is the first line to _ illustrate KillDoc method" Printer.Print "This is the second line to _ illustrate KillDoc method" Printer.Print "This is the third line to _ illustrate KillDoc method" If vbNo = MsgBox("Print this fine document?", _ vbYesNo) Then Printer.KillDoc Else Printer.EndDoc End If End Sub If the operating system’s Print Manager is handling the print job, the KillDoc method deletes the entire job you sent to the printer. However, if the Print Manager is not controlling the print job, page one may have already been sent to the printer, and will be unaffected by KillDoc. The amount of data sent to the printer varies slightly among printer drivers. Note You cannot use the KillDoc method to terminate a print job that was initiated with the PrintForm method. -----------------------------------------------------------------------------




این صفحه را در گوگل محبوب کنید

[ارسال شده از: سایت ریسک]
[مشاهده در: www.ri3k.eu]
[تعداد بازديد از اين مطلب: 514]

bt

اضافه شدن مطلب/حذف مطلب







-


گوناگون

پربازدیدترینها
طراحی وب>


صفحه اول | تمام مطالب | RSS | ارتباط با ما
1390© تمامی حقوق این سایت متعلق به سایت واضح می باشد.
این سایت در ستاد ساماندهی وزارت فرهنگ و ارشاد اسلامی ثبت شده است و پیرو قوانین جمهوری اسلامی ایران می باشد. لطفا در صورت برخورد با مطالب و صفحات خلاف قوانین در سایت آن را به ما اطلاع دهید
پایگاه خبری واضح کاری از شرکت طراحی سایت اینتن