Guidance
指路人
g.yi.org
software / rapidq / Examples / Devices / Printer & Parallel Port / printqr.bas

Register 
新用户注册
Search 搜索
首页 
Home Home
Software
Upload

  
'Print text (by the default printer)
'as it appears in QRichEdit:
'font, color, size, italic, bold, ...
'Very easy and very effective.
'By Stefaan Vermuyten
'February 1, 2003
'mail: stefaanvermuyten@hotmail.com

     $APPTYPE GUI
     $INCLUDE "Rapidq.inc"
     DECLARE SUB FontClick
     DECLARE SUB PrintClick
     DECLARE SUB ResizeClick
     DIM font1 AS QFONT
     DIM FontDialog AS QFONTDIALOG

     CREATE form AS QFORM
      CAPTION = "Print QRichEdit"
      Width = 640
      Height = 480
      ONResize = ResizeClick
      Center
      CREATE MainMenu AS QMAINMENU
       CREATE FontMenu AS QMENUITEM
        CAPTION = "Font"
        OnClick = FontClick
       END CREATE
       CREATE PrintItem AS QMENUITEM
        CAPTION = "Print"
        OnClick = PrintClick
       END CREATE
      END CREATE
      CREATE RichEdit AS QRICHEDIT
       Left = 0
       Top = 0
       Width = Form.ClientWidth
       Height = Form.ClientHeight
       ScrollBars = ssVertical
       Font = font1
      END CREATE
     END CREATE

     Form.SHOWMODAL

     SUB FontClick
      FontDialog.GetFont(font1)
      IF FontDialog.EXECUTE THEN
       FontDialog.SetFont(font1)
       RichEdit.Font = font1
      END IF
     END SUB

     SUB PrintClick
      Printer.font = font1
      LPRINT RichEdit.Text
      LFLUSH
     END SUB

     SUB ResizeClick
      RichEdit.Width = Form.ClientWidth
      RichEdit.Height = Form.ClientHeight
     END SUB
掌柜推荐
 
 
 
 
 
 
 
 
 
 
 
 
© Thu 2021-10-21  Guidance Laboratory Inc.
Email:webmaster1g.yi.org Hits:0 Last modified:2003-02-01 11:43:14