home *** CD-ROM | disk | FTP | other *** search
/ DP Tool Club 22 / CD_ASCQ_22_0695.iso / win / prg / flabel10 / sample / flsample.frm next >
Text File  |  1995-01-22  |  3KB  |  132 lines

  1. VERSION 2.00
  2. Begin Form Form1 
  3.    Caption         =   "FLabel Sample"
  4.    ClientHeight    =   3255
  5.    ClientLeft      =   1665
  6.    ClientTop       =   2400
  7.    ClientWidth     =   6630
  8.    Height          =   3660
  9.    Left            =   1605
  10.    LinkTopic       =   "Form1"
  11.    ScaleHeight     =   3255
  12.    ScaleWidth      =   6630
  13.    Top             =   2055
  14.    Width           =   6750
  15.    Begin CommandButton Command2 
  16.       Caption         =   "Exit"
  17.       Height          =   375
  18.       Left            =   3480
  19.       TabIndex        =   3
  20.       Top             =   2640
  21.       Width           =   1575
  22.    End
  23.    Begin CommandButton Command1 
  24.       Caption         =   "Print"
  25.       Height          =   375
  26.       Left            =   1680
  27.       TabIndex        =   2
  28.       Top             =   2640
  29.       Width           =   1575
  30.    End
  31.    Begin TextBox Text1 
  32.       Height          =   2175
  33.       Left            =   3480
  34.       MultiLine       =   -1  'True
  35.       TabIndex        =   0
  36.       Text            =   "Text1"
  37.       Top             =   240
  38.       Width           =   2895
  39.    End
  40.    Begin FLabel FLabel1 
  41.       AutoSize        =   0   'False
  42.       BackStyle       =   0  'Transparent
  43.       Caption         =   "FLabel1"
  44.       Delimiter       =   ""
  45.       Height          =   2175
  46.       Left            =   240
  47.       ParaBefore      =   0
  48.       ParaFirst       =   0
  49.       ParaLeft        =   0
  50.       ParaRight       =   0
  51.       TabIndex        =   1
  52.       Top             =   240
  53.       Width           =   3015
  54.       WordWrap        =   0   'False
  55.    End
  56. End
  57.  
  58. Option Explicit
  59.  
  60. Sub Command1_Click ()
  61.     ' draw box
  62.     Printer.Line (1320, 1320)-Step(6000, 1680), , B
  63.  
  64.     ' set up printer
  65.     FLabel1.PrinterScaleMode = Printer.ScaleMode
  66.  
  67.     ' print at left = 1", top = 1"
  68.     ' height = 1", width = 4"
  69.     FLabel1.PrinterTop = 1440
  70.     FLabel1.PrinterLeft = 1440
  71.     FLabel1.PrinterHeight = 1440
  72.     FLabel1.PrinterWidth = 4 * 1440
  73.  
  74.     ' print
  75.     FLabel1.PrinterHDC = Printer.hDC
  76.  
  77.     ' make sure printer object knows something has
  78.     ' happened
  79.     Printer.Print ""
  80.  
  81.     ' end job
  82.     Printer.EndDoc
  83. End Sub
  84.  
  85. Sub Command2_Click ()
  86.     ' get out
  87.     End
  88. End Sub
  89.  
  90. Sub Form_Load ()
  91.     FLabel1.ParaBefore = 240
  92.     FLabel1.ParaFirst = 480
  93.     FLabel1.WordWrap = True
  94.  
  95.     Text1.Text = "This is a test of |color:blue|FLabel VBX|color:black|.  Play with this text to change the formatting.  Then, try printing it.  You should see your text inside a box.|cr|It's fun ..."
  96. End Sub
  97.  
  98. Sub Form_Resize ()
  99.     FLabel1.Top = 240
  100.     FLabel1.Left = 240
  101.     FLabel1.Width = (Form1.ScaleWidth / 2) - 360
  102.     FLabel1.Height = Form1.ScaleHeight - 1080
  103.  
  104.     Text1.Top = 240
  105.     Text1.Left = (Form1.ScaleWidth / 2) + 120
  106.     Text1.Width = (Form1.ScaleWidth / 2) - 360
  107.     Text1.Height = Form1.ScaleHeight - 1080
  108.  
  109.     Command1.Top = Form1.ScaleHeight - 600
  110.     Command1.Left = (Form1.ScaleWidth / 2) - Command1.Width - 120
  111.  
  112.     Command2.Top = Form1.ScaleHeight - 600
  113.     Command2.Left = (Form1.ScaleWidth / 2) + 120
  114. End Sub
  115.  
  116. Sub Text1_Change ()
  117.     Dim Offset As Integer
  118.     Dim Temp As String
  119.  
  120.     Temp = Text1.Text
  121.  
  122.     Do While InStr(Temp, Chr(13) & Chr(10))
  123.         Offset = InStr(Temp, Chr(13) & Chr(10))
  124.  
  125.         Temp = Left(Temp, Offset - 1) & "|CR|" & Mid(Temp, Offset + 2)
  126.     Loop
  127.  
  128.     Text1.Text = Temp
  129.     FLabel1.Caption = Temp
  130. End Sub
  131.  
  132.