home *** CD-ROM | disk | FTP | other *** search
/ Planet Source Code Jumbo …e CD Visual Basic 1 to 7 / 5_2007-2008.ISO / data / Zips / Print_and_2066795212007.psc / Form1.frm < prev    next >
Text File  |  2007-05-21  |  5KB  |  167 lines

  1. VERSION 5.00
  2. Object = "{EAB22AC0-30C1-11CF-A7EB-0000C05BAE0B}#1.1#0"; "ieframe.dll"
  3. Object = "{F9043C88-F6F2-101A-A3C9-08002B2F49FB}#1.2#0"; "COMDLG32.OCX"
  4. Begin VB.Form frmMain 
  5.    Caption         =   "Print LynxGrid"
  6.    ClientHeight    =   5505
  7.    ClientLeft      =   60
  8.    ClientTop       =   450
  9.    ClientWidth     =   7200
  10.    LinkTopic       =   "Form1"
  11.    ScaleHeight     =   5505
  12.    ScaleWidth      =   7200
  13.    StartUpPosition =   3  'Windows Default
  14.    Begin VB.CommandButton cmdExportCSV 
  15.       Caption         =   "Export CSV"
  16.       Height          =   375
  17.       Left            =   3240
  18.       TabIndex        =   4
  19.       Top             =   5040
  20.       Width           =   1215
  21.    End
  22.    Begin MSComDlg.CommonDialog CommonDialog1 
  23.       Left            =   1560
  24.       Top             =   4920
  25.       _ExtentX        =   847
  26.       _ExtentY        =   847
  27.       _Version        =   393216
  28.    End
  29.    Begin VB.CommandButton cmdPrintPreview 
  30.       Caption         =   "Print Preview"
  31.       Height          =   375
  32.       Left            =   4560
  33.       TabIndex        =   3
  34.       Top             =   5040
  35.       Width           =   1215
  36.    End
  37.    Begin VB.CommandButton cmdPrint 
  38.       Caption         =   "Print"
  39.       Height          =   375
  40.       Left            =   5880
  41.       TabIndex        =   2
  42.       Top             =   5040
  43.       Width           =   1215
  44.    End
  45.    Begin Project1.LynxGrid LynxGrid1 
  46.       Height          =   4815
  47.       Left            =   120
  48.       TabIndex        =   1
  49.       Top             =   120
  50.       Width           =   6975
  51.       _ExtentX        =   12303
  52.       _ExtentY        =   8493
  53.       BeginProperty Font {0BE35203-8F91-11CE-9DE3-00AA004BB851} 
  54.          Name            =   "MS Sans Serif"
  55.          Size            =   8.25
  56.          Charset         =   0
  57.          Weight          =   400
  58.          Underline       =   0   'False
  59.          Italic          =   0   'False
  60.          Strikethrough   =   0   'False
  61.       EndProperty
  62.    End
  63.    Begin SHDocVwCtl.WebBrowser WebPreview 
  64.       Height          =   375
  65.       Left            =   240
  66.       TabIndex        =   0
  67.       Top             =   5040
  68.       Width           =   975
  69.       ExtentX         =   1720
  70.       ExtentY         =   661
  71.       ViewMode        =   0
  72.       Offline         =   0
  73.       Silent          =   0
  74.       RegisterAsBrowser=   0
  75.       RegisterAsDropTarget=   1
  76.       AutoArrange     =   0   'False
  77.       NoClientEdge    =   0   'False
  78.       AlignLeft       =   0   'False
  79.       NoWebView       =   0   'False
  80.       HideFileNames   =   0   'False
  81.       SingleClick     =   0   'False
  82.       SingleSelection =   0   'False
  83.       NoFolders       =   0   'False
  84.       Transparent     =   0   'False
  85.       ViewID          =   "{0057D0E0-3573-11CF-AE69-08002B2E1262}"
  86.       Location        =   ""
  87.    End
  88. End
  89. Attribute VB_Name = "frmMain"
  90. Attribute VB_GlobalNameSpace = False
  91. Attribute VB_Creatable = False
  92. Attribute VB_PredeclaredId = True
  93. Attribute VB_Exposed = False
  94. Option Explicit
  95.  
  96. Private Function getSaveCSVFileName() As String
  97.  
  98.     With CommonDialog1
  99.         .FileName = vbNullString
  100.         .DialogTitle = "Save File as..."
  101.         .InitDir = App.Path ' 1.88
  102.         .Flags = cdlOFNHideReadOnly
  103.         .Filter = "Comma Delimited File (*.csv)|*.csv;"
  104.         .CancelError = False
  105.         .ShowSave
  106.         getSaveCSVFileName = .FileName
  107.     End With 'FRMMASTER.MAPDIAG
  108.  
  109. End Function
  110.  
  111. Private Sub cmdExportCSV_Click()
  112.  
  113. Dim FullFileName As String
  114. Dim newLynxPrint As New clsLynxPrint
  115.  
  116.     FullFileName = getSaveCSVFileName
  117.     If LenB(FullFileName) <> 0 Then
  118.         newLynxPrint.LynxGridExportToCSV LynxGrid1, FullFileName
  119.     End If
  120.  
  121. End Sub
  122.  
  123. Private Sub cmdPrint_Click()
  124.  
  125. Dim newLynxPrint As New clsLynxPrint
  126.     newLynxPrint.DocTitle = "Hello"
  127.     newLynxPrint.PrintLynxGrid LynxGrid1, WebPreview, StraightToPrinter
  128.  
  129. End Sub
  130.  
  131. Private Sub cmdPrintPreview_Click()
  132.  
  133. Dim newLynxPrint As New clsLynxPrint
  134.     newLynxPrint.DocTitle = "Hello"
  135.     newLynxPrint.PrintLynxGrid LynxGrid1, WebPreview, PrintPreview
  136.  
  137. End Sub
  138.  
  139. Private Sub Form_Load()
  140.  
  141.     WebPreview.Move 0, 0, 0, 0
  142.     WebPreview.Visible = False
  143.     popLynxGrid1
  144.  
  145. End Sub
  146.  
  147. Private Sub popLynxGrid1()
  148.  
  149. Dim lnRowCounter As Long
  150.  
  151.     With LynxGrid1
  152.         .Redraw = False
  153.         .AddColumn "Col 1", 1500
  154.         .AddColumn "Col 2", 1500
  155.         .AddColumn "Col 3", 1500
  156.         .AddColumn "Col 4", 1500
  157.         For lnRowCounter = 0 To 100
  158.             .AddItem "A" & lnRowCounter & vbTab & _
  159.                      "B" & lnRowCounter & vbTab & _
  160.                      "C" & lnRowCounter & vbTab & _
  161.                      "D" & lnRowCounter
  162.         Next lnRowCounter
  163.         .Redraw = True
  164.     End With
  165.  
  166. End Sub
  167.