上传用户:zhpu1995
上传日期:2013-09-06
资源大小:61151k
文件大小:17k
源码类别:

企业管理

开发平台:

Visual Basic

  1. VERSION 5.00
  2. Object = "{65A39231-6133-11D1-BAA2-444553540000}#1.0#0"; "vslight6.OCX"
  3. Object = "{7E00A3A2-8F5C-11D2-BAA4-04F205C10000}#1.0#0"; "VSVIEW6.OCX"
  4. Object = "{D76D7128-4A96-11D3-BD95-D296DC2DD072}#1.0#0"; "VSOCX7.OCX"
  5. Object = "{831FDD16-0C5C-11D2-A9FC-0000F8754DA1}#2.0#0"; "mscomctl.ocx"
  6. Begin VB.Form DY_Tybbyldy 
  7.    Caption         =   "报表预览"
  8.    ClientHeight    =   7755
  9.    ClientLeft      =   60
  10.    ClientTop       =   345
  11.    ClientWidth     =   10890
  12.    HelpContextID   =   2111004
  13.    Icon            =   "系统_打印预览.frx":0000
  14.    LinkTopic       =   "Form1"
  15.    ScaleHeight     =   7755
  16.    ScaleWidth      =   10890
  17.    StartUpPosition =   2  '屏幕中心
  18.    Begin VB.PictureBox Picture1 
  19.       Appearance      =   0  'Flat
  20.       BorderStyle     =   0  'None
  21.       ForeColor       =   &H80000008&
  22.       Height          =   225
  23.       Left            =   7020
  24.       ScaleHeight     =   225
  25.       ScaleWidth      =   3795
  26.       TabIndex        =   6
  27.       Top             =   60
  28.       Width           =   3795
  29.       Begin VB.Label label1 
  30.          BackStyle       =   0  'Transparent
  31.          Caption         =   "显示比例"
  32.          ForeColor       =   &H00000000&
  33.          Height          =   300
  34.          Left            =   120
  35.          TabIndex        =   10
  36.          Top             =   30
  37.          Width           =   825
  38.       End
  39.       Begin VB.Label Label2 
  40.          BackStyle       =   0  'Transparent
  41.          Caption         =   "当前页号:"
  42.          ForeColor       =   &H00000000&
  43.          Height          =   270
  44.          Left            =   1200
  45.          TabIndex        =   9
  46.          Top             =   30
  47.          Width           =   855
  48.       End
  49.       Begin VB.Label Gjyh 
  50.          ForeColor       =   &H00000000&
  51.          Height          =   300
  52.          Left            =   2640
  53.          TabIndex        =   8
  54.          Top             =   30
  55.          Width           =   975
  56.       End
  57.       Begin VB.Label Dqyh 
  58.          ForeColor       =   &H00FF0000&
  59.          Height          =   300
  60.          Left            =   2010
  61.          TabIndex        =   7
  62.          Top             =   30
  63.          Width           =   615
  64.       End
  65.    End
  66.    Begin MSComctlLib.ImageList ImageList1 
  67.       Left            =   4740
  68.       Top             =   60
  69.       _ExtentX        =   1005
  70.       _ExtentY        =   1005
  71.       BackColor       =   -2147483643
  72.       ImageWidth      =   16
  73.       ImageHeight     =   16
  74.       MaskColor       =   12632256
  75.       _Version        =   393216
  76.       BeginProperty Images {2C247F25-8591-11D1-B16A-00C0F0283628} 
  77.          NumListImages   =   5
  78.          BeginProperty ListImage1 {2C247F27-8591-11D1-B16A-00C0F0283628} 
  79.             Picture         =   "系统_打印预览.frx":1042
  80.             Key             =   "dy"
  81.          EndProperty
  82.          BeginProperty ListImage2 {2C247F27-8591-11D1-B16A-00C0F0283628} 
  83.             Picture         =   "系统_打印预览.frx":13DC
  84.             Key             =   "sy"
  85.          EndProperty
  86.          BeginProperty ListImage3 {2C247F27-8591-11D1-B16A-00C0F0283628} 
  87.             Picture         =   "系统_打印预览.frx":1776
  88.             Key             =   "xy"
  89.          EndProperty
  90.          BeginProperty ListImage4 {2C247F27-8591-11D1-B16A-00C0F0283628} 
  91.             Picture         =   "系统_打印预览.frx":1B10
  92.             Key             =   "bz"
  93.          EndProperty
  94.          BeginProperty ListImage5 {2C247F27-8591-11D1-B16A-00C0F0283628} 
  95.             Picture         =   "系统_打印预览.frx":1EAA
  96.             Key             =   "tc"
  97.          EndProperty
  98.       EndProperty
  99.    End
  100.    Begin VSFlex8Ctl.VSFlexGrid DyylGrid 
  101.       Height          =   705
  102.       Left            =   2850
  103.       TabIndex        =   5
  104.       Top             =   -30
  105.       Visible         =   0   'False
  106.       Width           =   2775
  107.       _ExtentX        =   4895
  108.       _ExtentY        =   1244
  109.       Appearance      =   1
  110.       BorderStyle     =   1
  111.       Enabled         =   -1  'True
  112.       BeginProperty Font {0BE35203-8F91-11CE-9DE3-00AA004BB851} 
  113.          Name            =   "宋体"
  114.          Size            =   9
  115.          Charset         =   134
  116.          Weight          =   400
  117.          Underline       =   0   'False
  118.          Italic          =   0   'False
  119.          Strikethrough   =   0   'False
  120.       EndProperty
  121.       MousePointer    =   0
  122.       BackColor       =   -2147483643
  123.       ForeColor       =   -2147483640
  124.       BackColorFixed  =   -2147483633
  125.       ForeColorFixed  =   -2147483630
  126.       BackColorSel    =   -2147483635
  127.       ForeColorSel    =   -2147483634
  128.       BackColorBkg    =   -2147483636
  129.       BackColorAlternate=   -2147483643
  130.       GridColor       =   -2147483633
  131.       GridColorFixed  =   -2147483632
  132.       TreeColor       =   -2147483632
  133.       FloodColor      =   192
  134.       SheetBorder     =   -2147483642
  135.       FocusRect       =   1
  136.       HighLight       =   1
  137.       AllowSelection  =   -1  'True
  138.       AllowBigSelection=   -1  'True
  139.       AllowUserResizing=   0
  140.       SelectionMode   =   0
  141.       GridLines       =   1
  142.       GridLinesFixed  =   2
  143.       GridLineWidth   =   1
  144.       Rows            =   50
  145.       Cols            =   10
  146.       FixedRows       =   1
  147.       FixedCols       =   0
  148.       RowHeightMin    =   0
  149.       RowHeightMax    =   0
  150.       ColWidthMin     =   0
  151.       ColWidthMax     =   0
  152.       ExtendLastCol   =   0   'False
  153.       FormatString    =   ""
  154.       ScrollTrack     =   0   'False
  155.       ScrollBars      =   3
  156.       ScrollTips      =   0   'False
  157.       MergeCells      =   0
  158.       MergeCompare    =   0
  159.       AutoResize      =   -1  'True
  160.       AutoSizeMode    =   0
  161.       AutoSearch      =   0
  162.       MultiTotals     =   -1  'True
  163.       SubtotalPosition=   1
  164.       OutlineBar      =   0
  165.       OutlineCol      =   0
  166.       Ellipsis        =   0
  167.       ExplorerBar     =   0
  168.       PicturesOver    =   0   'False
  169.       FillStyle       =   0
  170.       RightToLeft     =   0   'False
  171.       PictureType     =   0
  172.       TabBehavior     =   0
  173.       OwnerDraw       =   0
  174.       Editable        =   0   'False
  175.       ShowComboButton =   -1  'True
  176.       WordWrap        =   0   'False
  177.       TextStyle       =   0
  178.       TextStyleFixed  =   0
  179.       OleDragMode     =   0
  180.       OleDropMode     =   0
  181.       DataMode        =   0
  182.       VirtualData     =   -1  'True
  183.    End
  184.    Begin MSComctlLib.StatusBar DYStatus 
  185.       Align           =   2  'Align Bottom
  186.       Height          =   405
  187.       Left            =   0
  188.       TabIndex        =   3
  189.       Top             =   7350
  190.       Width           =   10890
  191.       _ExtentX        =   19209
  192.       _ExtentY        =   714
  193.       _Version        =   393216
  194.       BeginProperty Panels {8E3867A5-8586-11D1-B16A-00C0F0283628} 
  195.          NumPanels       =   3
  196.          BeginProperty Panel1 {8E3867AB-8586-11D1-B16A-00C0F0283628} 
  197.             AutoSize        =   2
  198.          EndProperty
  199.          BeginProperty Panel2 {8E3867AB-8586-11D1-B16A-00C0F0283628} 
  200.             AutoSize        =   2
  201.          EndProperty
  202.          BeginProperty Panel3 {8E3867AB-8586-11D1-B16A-00C0F0283628} 
  203.             AutoSize        =   1
  204.             Object.Width           =   13573
  205.          EndProperty
  206.       EndProperty
  207.    End
  208.    Begin VB.HScrollBar PageHScroll 
  209.       Height          =   300
  210.       Left            =   8025
  211.       TabIndex        =   2
  212.       Top             =   345
  213.       Width           =   2715
  214.    End
  215.    Begin VB.ComboBox Xsbl 
  216.       Height          =   300
  217.       Left            =   7080
  218.       Style           =   2  'Dropdown List
  219.       TabIndex        =   1
  220.       Top             =   345
  221.       Width           =   885
  222.    End
  223.    Begin VSVIEW6Ctl.VSPrinter Tydy 
  224.       Height          =   6615
  225.       Left            =   60
  226.       TabIndex        =   0
  227.       Top             =   720
  228.       Width           =   10680
  229.       _cx             =   4213142
  230.       _cy             =   4205972
  231.       Appearance      =   1
  232.       BorderStyle     =   1
  233.       Enabled         =   -1  'True
  234.       MousePointer    =   0
  235.       BackColor       =   -2147483643
  236.       BeginProperty Font {0BE35203-8F91-11CE-9DE3-00AA004BB851} 
  237.          Name            =   "宋体"
  238.          Size            =   9
  239.          Charset         =   134
  240.          Weight          =   400
  241.          Underline       =   0   'False
  242.          Italic          =   0   'False
  243.          Strikethrough   =   0   'False
  244.       EndProperty
  245.       BeginProperty HdrFont {0BE35203-8F91-11CE-9DE3-00AA004BB851} 
  246.          Name            =   "Courier New"
  247.          Size            =   14.25
  248.          Charset         =   0
  249.          Weight          =   400
  250.          Underline       =   0   'False
  251.          Italic          =   0   'False
  252.          Strikethrough   =   0   'False
  253.       EndProperty
  254.       AutoRTF         =   -1  'True
  255.       Preview         =   -1  'True
  256.       DefaultDevice   =   0   'False
  257.       PhysicalPage    =   -1  'True
  258.       AbortWindow     =   -1  'True
  259.       AbortWindowPos  =   0
  260.       AbortCaption    =   "Printing..."
  261.       AbortTextButton =   "Cancel"
  262.       AbortTextDevice =   "on the %s on %s"
  263.       AbortTextPage   =   "Now printing Page %d of"
  264.       FileName        =   ""
  265.       MarginLeft      =   1440
  266.       MarginTop       =   1440
  267.       MarginRight     =   1440
  268.       MarginBottom    =   1440
  269.       MarginHeader    =   0
  270.       MarginFooter    =   0
  271.       IndentLeft      =   0
  272.       IndentRight     =   0
  273.       IndentFirst     =   0
  274.       IndentTab       =   720
  275.       SpaceBefore     =   0
  276.       SpaceAfter      =   0
  277.       LineSpacing     =   100
  278.       Columns         =   1
  279.       ColumnSpacing   =   180
  280.       ShowGuides      =   2
  281.       LargeChangeHorz =   300
  282.       LargeChangeVert =   300
  283.       SmallChangeHorz =   500
  284.       SmallChangeVert =   500
  285.       Track           =   0   'False
  286.       ProportionalBars=   -1  'True
  287.       Zoom            =   36.096256684492
  288.       ZoomMode        =   3
  289.       ZoomMax         =   400
  290.       ZoomMin         =   10
  291.       ZoomStep        =   40
  292.       MouseZoom       =   1
  293.       MouseScroll     =   -1  'True
  294.       MousePage       =   -1  'True
  295.       EmptyColor      =   -2147483636
  296.       TextColor       =   0
  297.       HdrColor        =   0
  298.       BrushColor      =   0
  299.       BrushStyle      =   0
  300.       PenColor        =   0
  301.       PenStyle        =   0
  302.       PenWidth        =   0
  303.       PageBorder      =   0
  304.       Header          =   ""
  305.       Footer          =   ""
  306.       TableSep        =   "|;"
  307.       TableBorder     =   7
  308.       TablePen        =   0
  309.       TablePenLR      =   0
  310.       TablePenTB      =   0
  311.       HTMLStyle       =   1
  312.       Begin VB.Image Image1 
  313.          Height          =   1140
  314.          Left            =   855
  315.          Picture         =   "系统_打印预览.frx":2244
  316.          Top             =   2385
  317.          Visible         =   0   'False
  318.          Width           =   1065
  319.       End
  320.    End
  321.    Begin MSComctlLib.Toolbar YlToolbar 
  322.       Align           =   1  'Align Top
  323.       Height          =   630
  324.       Left            =   0
  325.       TabIndex        =   4
  326.       Top             =   0
  327.       Width           =   10890
  328.       _ExtentX        =   19209
  329.       _ExtentY        =   1111
  330.       ButtonWidth     =   900
  331.       ButtonHeight    =   953
  332.       AllowCustomize  =   0   'False
  333.       Appearance      =   1
  334.       HelpContextID   =   2111004
  335.       ImageList       =   "ImageList1"
  336.       _Version        =   393216
  337.       BeginProperty Buttons {66833FE8-8583-11D1-B16A-00C0F0283628} 
  338.          NumButtons      =   7
  339.          BeginProperty Button1 {66833FEA-8583-11D1-B16A-00C0F0283628} 
  340.             Caption         =   "打 印"
  341.             Key             =   "dy"
  342.             ImageKey        =   "dy"
  343.          EndProperty
  344.          BeginProperty Button2 {66833FEA-8583-11D1-B16A-00C0F0283628} 
  345.             Style           =   3
  346.          EndProperty
  347.          BeginProperty Button3 {66833FEA-8583-11D1-B16A-00C0F0283628} 
  348.             Caption         =   "上 页"
  349.             Key             =   "sy"
  350.             ImageKey        =   "sy"
  351.          EndProperty
  352.          BeginProperty Button4 {66833FEA-8583-11D1-B16A-00C0F0283628} 
  353.             Caption         =   "下 页"
  354.             Key             =   "xy"
  355.             ImageKey        =   "xy"
  356.          EndProperty
  357.          BeginProperty Button5 {66833FEA-8583-11D1-B16A-00C0F0283628} 
  358.             Style           =   3
  359.          EndProperty
  360.          BeginProperty Button6 {66833FEA-8583-11D1-B16A-00C0F0283628} 
  361.             Caption         =   "帮 助"
  362.             Key             =   "bz"
  363.             ImageKey        =   "bz"
  364.          EndProperty
  365.          BeginProperty Button7 {66833FEA-8583-11D1-B16A-00C0F0283628} 
  366.             Caption         =   "返 回"
  367.             Key             =   "fh"
  368.             ImageKey        =   "tc"
  369.          EndProperty
  370.       EndProperty
  371.    End
  372. End
  373. Attribute VB_Name = "DY_Tybbyldy"
  374. Attribute VB_GlobalNameSpace = False
  375. Attribute VB_Creatable = False
  376. Attribute VB_PredeclaredId = True
  377. Attribute VB_Exposed = False
  378. '*******************************************************
  379. '*    模 块 名 称 :报表打印预览
  380. '*    功 能 描 述 :实现对报表按各种比例的模拟显示
  381. '*    程序员姓名  :张建忠
  382. '*    最后修改人  :张建忠
  383. '*    最后修改时间:2001/06/23
  384. '*    备        注:封版
  385. '*******************************************************
  386. Dim Ylzybl As Double, ylms As Integer                 '预 览 整 页 比 例
  387. Dim Changelock As Boolean                             '程 序 改 变 值 控 制 锁
  388. Private Sub PageHScroll_Change()                      '利用滚动条改变页号
  389.     With Tydy
  390.         If Not Changelock Then
  391.             .PreviewPage = PageHScroll.Value
  392.             If .PreviewPage = 1 Then
  393.                 YlToolbar.Buttons("sy").Enabled = False
  394.             Else
  395.                 YlToolbar.Buttons("sy").Enabled = True
  396.             End If
  397.             If .PreviewPage < .Pagecount Then
  398.                 YlToolbar.Buttons("xy").Enabled = True
  399.             Else
  400.                 YlToolbar.Buttons("xy").Enabled = False
  401.             End If
  402.         End If
  403.         Dqyh = Trim(Str(.PreviewPage))
  404.         Gjyh = "(共计:" + Trim(Str(.Pagecount)) + "页)"
  405.     End With
  406. End Sub
  407. Private Sub Tydy_MouseDown(Button As Integer, Shift As Integer, x As Single, y As Single)
  408.     With Tydy
  409.         If .Zoom <> 100 Then
  410.             .Zoom = 100
  411.             Xsbl.Text = "100%"
  412.         Else
  413.             Changelock = True
  414.             .ZoomMode = ylms
  415.             Select Case .ZoomMode
  416.                 Case zmPageWidth
  417.                     Xsbl.Text = "页宽"
  418.                 Case zmWholePage
  419.                     Xsbl.Text = "整页"
  420.                 Case zmThumbnail
  421.                     Xsbl.Text = "双页"
  422.             End Select
  423.             Changelock = False
  424.         End If
  425.     End With
  426. End Sub
  427. Private Sub Xsbl_Click()                  '调 整 预 览 比 例
  428.     If Changelock Then
  429.         Exit Sub
  430.     End If
  431.     With Tydy
  432.         Select Case Xsbl.Text
  433.             Case "页宽"
  434.                 .ZoomMode = zmPageWidth
  435.                 ylms = .ZoomMode
  436.             Case "整页"
  437.                 .ZoomMode = zmWholePage
  438.                 ylms = .ZoomMode
  439.             Case "双页"
  440.                 .ZoomMode = zmThumbnail
  441.                 ylms = .ZoomMode
  442.             Case Else
  443.                 .Zoom = Val(Mid(Xsbl.Text, 1, Len(Xsbl.Text) - 1))
  444.         End Select
  445.     End With
  446. End Sub
  447. Private Sub Form_Load()
  448.     Me.HelpContextID = 2111004
  449.    
  450.     With Tydy
  451.         Ylzybl = .Zoom
  452.         .ZoomMax = 400
  453.         .ZoomMin = 25
  454.     End With
  455.     With Xsbl
  456.         .AddItem "页宽"
  457.         .AddItem "整页"
  458.         .AddItem "双页"
  459.         .AddItem "10%"
  460.         .AddItem "25%"
  461.         .AddItem "50%"
  462.         .AddItem "75%"
  463.         .AddItem "100%"
  464.         .AddItem "150%"
  465.         .AddItem "200%"
  466.         .AddItem "400%"
  467.         Changelock = True
  468.         .Text = "整页"
  469.         ylms = Tydy.ZoomMode
  470.         Changelock = False
  471.     End With
  472. End Sub
  473. Private Sub Qpage()                             '向 前 翻 页
  474.     With Tydy
  475.         If .PreviewPage > 1 Then
  476.             .PreviewPage = .PreviewPage - 1
  477.             If .PreviewPage = 1 Then
  478.                 YlToolbar.Buttons("sy").Enabled = False
  479.             End If
  480.             If .PreviewPage < .Pagecount Then
  481.                 YlToolbar.Buttons("xy").Enabled = True
  482.             End If
  483.             Changelock = True
  484.             PageHScroll.Value = .PreviewPage
  485.             Changelock = False
  486.         End If
  487.     End With
  488. End Sub
  489. Private Sub Hpage()                        '向 后 翻 页
  490.     With Tydy
  491.         If .PreviewPage < .Pagecount Then
  492.             .PreviewPage = .PreviewPage + 1
  493.             If .PreviewPage > 1 Then
  494.                 YlToolbar.Buttons("sy").Enabled = True
  495.             End If
  496.             If .PreviewPage >= .Pagecount Then
  497.                 YlToolbar.Buttons("xy").Enabled = False
  498.             End If
  499.             Changelock = True
  500.             PageHScroll.Value = .PreviewPage
  501.             Changelock = False
  502.         End If
  503.     End With
  504.   
  505. End Sub
  506. Private Sub YlToolbar_ButtonClick(ByVal Button As MSComctlLib.Button)      '点击工具条
  507.     Select Case Button.Key
  508.         Case "dy"
  509.             Call dyscbb
  510.         Case "sy"
  511.             Call Qpage
  512.         Case "xy"
  513.             Call Hpage
  514.         Case "fh"
  515.             Unload Me
  516.         Case "bz"
  517.             Call F1bz
  518.     End Select
  519. End Sub