home *** CD-ROM | disk | FTP | other *** search
/ C!T ROM 5 / ctrom5b.zip / ctrom5b / PROGRAM / VISBASIC / MSMEGA / ROTEXTSA.ZIP / RSAMPLE2.FRM < prev    next >
Text File  |  1994-12-29  |  4KB  |  137 lines

  1. VERSION 2.00
  2. Begin Form Form1 
  3.    BorderStyle     =   3  'Fixed Double
  4.    Caption         =   "RoText Printing Sample"
  5.    ClientHeight    =   1755
  6.    ClientLeft      =   1125
  7.    ClientTop       =   1860
  8.    ClientWidth     =   5535
  9.    Height          =   2160
  10.    Left            =   1065
  11.    LinkTopic       =   "Form1"
  12.    ScaleHeight     =   1755
  13.    ScaleWidth      =   5535
  14.    Top             =   1515
  15.    Width           =   5655
  16.    Begin CommandButton Command1 
  17.       Caption         =   "Print"
  18.       Default         =   -1  'True
  19.       Height          =   375
  20.       Left            =   3840
  21.       TabIndex        =   5
  22.       Top             =   720
  23.       Width           =   1455
  24.    End
  25.    Begin CommandButton btnExit 
  26.       Cancel          =   -1  'True
  27.       Caption         =   "Exit"
  28.       Height          =   375
  29.       Left            =   3840
  30.       TabIndex        =   4
  31.       Top             =   240
  32.       Width           =   1455
  33.    End
  34.    Begin TextBox txtCount 
  35.       Height          =   285
  36.       Left            =   240
  37.       TabIndex        =   3
  38.       Top             =   1200
  39.       Width           =   3255
  40.    End
  41.    Begin TextBox txtPrint 
  42.       Height          =   285
  43.       Left            =   240
  44.       TabIndex        =   1
  45.       Text            =   "The quick brown fox ..."
  46.       Top             =   480
  47.       Width           =   3255
  48.    End
  49.    Begin RoText RoText1 
  50.       Angle           =   0
  51.       Caption         =   "RoText1"
  52.       FontBold        =   -1  'True
  53.       FontItalic      =   0   'False
  54.       FontName        =   "Arial"
  55.       FontSize        =   24
  56.       FontStrikethru  =   0   'False
  57.       FontUnderline   =   0   'False
  58.       Height          =   495
  59.       Left            =   3480
  60.       TabIndex        =   6
  61.       Top             =   1200
  62.       Visible         =   0   'False
  63.       Width           =   2055
  64.    End
  65.    Begin Label Label2 
  66.       Caption         =   "Number of Items:"
  67.       Height          =   255
  68.       Left            =   240
  69.       TabIndex        =   2
  70.       Top             =   960
  71.       Width           =   1575
  72.    End
  73.    Begin Label Label1 
  74.       Caption         =   "Text to Print:"
  75.       Height          =   255
  76.       Left            =   240
  77.       TabIndex        =   0
  78.       Top             =   240
  79.       Width           =   1695
  80.    End
  81. End
  82. Option Explicit
  83.  
  84. Sub btnExit_Click ()
  85.     ' get out
  86.     End
  87. End Sub
  88.  
  89. Sub Command1_Click ()
  90.     Dim Count As Integer
  91.     Dim I As Long
  92.  
  93.     ' let the user know we're busy
  94.     Form1.MousePointer = 11
  95.  
  96.     Count = Val(txtCount)
  97.  
  98.     If Count <= 0 Then
  99.         Count = 1
  100.     End If
  101.  
  102.     ' set up RoText and print area
  103.     RoText1.Caption = txtPrint
  104.     RoText1.PrinterTop = 1440
  105.     RoText1.PrinterLeft = 1440
  106.     RoText1.PrinterWidth = 6.5 * 1440
  107.     RoText1.PrinterHeight = 9 * 1440
  108.     RoText1.PrinterScaleMode = Printer.ScaleMode
  109.  
  110.     ' print rotated text
  111.     For I = 0 To Count - 1
  112.         DoEvents
  113.  
  114.         RoText1.Angle = (360& * I) / Count
  115.         RoText1.PrinterHDC = Printer.hDC
  116.     Next I
  117.  
  118.     ' record what we did
  119.     Printer.CurrentX = 1440
  120.     Printer.CurrentY = 1440
  121.     Printer.FontName = "Arial"
  122.     Printer.FontSize = 18
  123.     Printer.FontBold = True
  124.     Printer.Print Count & " times " & Chr(34) & txtPrint & Chr(34)
  125.  
  126.     Printer.EndDoc
  127.  
  128.     ' OK, we're done now
  129.     Form1.MousePointer = 0
  130. End Sub
  131.  
  132. Sub Form_Unload (Cancel As Integer)
  133.     ' get out
  134.     End
  135. End Sub
  136.  
  137.