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

企业管理

开发平台:

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     =   10755
  12.    HelpContextID   =   1601003
  13.    Icon            =   "系统_打印预览.frx":0000
  14.    LinkTopic       =   "Form1"
  15.    ScaleHeight     =   7755
  16.    ScaleWidth      =   10755
  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.       Font            =   "系统_打印预览.frx":2244
  113.       MousePointer    =   0
  114.       BackColor       =   -2147483643
  115.       ForeColor       =   -2147483640
  116.       BackColorFixed  =   -2147483633
  117.       ForeColorFixed  =   -2147483630
  118.       BackColorSel    =   -2147483635
  119.       ForeColorSel    =   -2147483634
  120.       BackColorBkg    =   -2147483636
  121.       BackColorAlternate=   -2147483643
  122.       GridColor       =   -2147483633
  123.       GridColorFixed  =   -2147483632
  124.       TreeColor       =   -2147483632
  125.       FloodColor      =   192
  126.       SheetBorder     =   -2147483642
  127.       FocusRect       =   1
  128.       HighLight       =   1
  129.       AllowSelection  =   -1  'True
  130.       AllowBigSelection=   -1  'True
  131.       AllowUserResizing=   0
  132.       SelectionMode   =   0
  133.       GridLines       =   1
  134.       GridLinesFixed  =   2
  135.       GridLineWidth   =   1
  136.       Rows            =   50
  137.       Cols            =   10
  138.       FixedRows       =   1
  139.       FixedCols       =   0
  140.       RowHeightMin    =   0
  141.       RowHeightMax    =   0
  142.       ColWidthMin     =   0
  143.       ColWidthMax     =   0
  144.       ExtendLastCol   =   0   'False
  145.       FormatString    =   ""
  146.       ScrollTrack     =   0   'False
  147.       ScrollBars      =   3
  148.       ScrollTips      =   0   'False
  149.       MergeCells      =   0
  150.       MergeCompare    =   0
  151.       AutoResize      =   -1  'True
  152.       AutoSizeMode    =   0
  153.       AutoSearch      =   0
  154.       MultiTotals     =   -1  'True
  155.       SubtotalPosition=   1
  156.       OutlineBar      =   0
  157.       OutlineCol      =   0
  158.       Ellipsis        =   0
  159.       ExplorerBar     =   0
  160.       PicturesOver    =   0   'False
  161.       FillStyle       =   0
  162.       RightToLeft     =   0   'False
  163.       PictureType     =   0
  164.       TabBehavior     =   0
  165.       OwnerDraw       =   0
  166.       Editable        =   0   'False
  167.       ShowComboButton =   -1  'True
  168.       WordWrap        =   0   'False
  169.       TextStyle       =   0
  170.       TextStyleFixed  =   0
  171.       OleDragMode     =   0
  172.       OleDropMode     =   0
  173.       DataMode        =   0
  174.       VirtualData     =   -1  'True
  175.    End
  176.    Begin MSComctlLib.StatusBar DYStatus 
  177.       Align           =   2  'Align Bottom
  178.       Height          =   405
  179.       Left            =   0
  180.       TabIndex        =   3
  181.       Top             =   7350
  182.       Width           =   10755
  183.       _ExtentX        =   18971
  184.       _ExtentY        =   714
  185.       _Version        =   393216
  186.       BeginProperty Panels {8E3867A5-8586-11D1-B16A-00C0F0283628} 
  187.          NumPanels       =   3
  188.          BeginProperty Panel1 {8E3867AB-8586-11D1-B16A-00C0F0283628} 
  189.             AutoSize        =   2
  190.          EndProperty
  191.          BeginProperty Panel2 {8E3867AB-8586-11D1-B16A-00C0F0283628} 
  192.             AutoSize        =   2
  193.          EndProperty
  194.          BeginProperty Panel3 {8E3867AB-8586-11D1-B16A-00C0F0283628} 
  195.             AutoSize        =   1
  196.             Object.Width           =   13335
  197.          EndProperty
  198.       EndProperty
  199.    End
  200.    Begin VB.HScrollBar PageHScroll 
  201.       Height          =   300
  202.       Left            =   8025
  203.       TabIndex        =   2
  204.       Top             =   345
  205.       Width           =   2715
  206.    End
  207.    Begin VB.ComboBox Xsbl 
  208.       Height          =   300
  209.       Left            =   7080
  210.       Style           =   2  'Dropdown List
  211.       TabIndex        =   1
  212.       Top             =   345
  213.       Width           =   885
  214.    End
  215.    Begin VSVIEW6Ctl.VSPrinter Tydy 
  216.       Height          =   6615
  217.       Left            =   60
  218.       TabIndex        =   0
  219.       Top             =   720
  220.       Width           =   10680
  221.       _cx             =   4213142
  222.       _cy             =   4205972
  223.       Appearance      =   1
  224.       BorderStyle     =   1
  225.       Enabled         =   -1  'True
  226.       MousePointer    =   0
  227.       BackColor       =   -2147483643
  228.       Font            =   "系统_打印预览.frx":2267
  229.       HdrFont         =   "系统_打印预览.frx":228A
  230.       AutoRTF         =   -1  'True
  231.       Preview         =   -1  'True
  232.       DefaultDevice   =   0   'False
  233.       PhysicalPage    =   -1  'True
  234.       AbortWindow     =   -1  'True
  235.       AbortWindowPos  =   0
  236.       AbortCaption    =   "Printing..."
  237.       AbortTextButton =   "Cancel"
  238.       AbortTextDevice =   "on the %s on %s"
  239.       AbortTextPage   =   "Now printing Page %d of"
  240.       FileName        =   ""
  241.       MarginLeft      =   1440
  242.       MarginTop       =   1440
  243.       MarginRight     =   1440
  244.       MarginBottom    =   1440
  245.       MarginHeader    =   0
  246.       MarginFooter    =   0
  247.       IndentLeft      =   0
  248.       IndentRight     =   0
  249.       IndentFirst     =   0
  250.       IndentTab       =   720
  251.       SpaceBefore     =   0
  252.       SpaceAfter      =   0
  253.       LineSpacing     =   100
  254.       Columns         =   1
  255.       ColumnSpacing   =   180
  256.       ShowGuides      =   2
  257.       LargeChangeHorz =   300
  258.       LargeChangeVert =   300
  259.       SmallChangeHorz =   500
  260.       SmallChangeVert =   500
  261.       Track           =   0   'False
  262.       ProportionalBars=   -1  'True
  263.       Zoom            =   36.096256684492
  264.       ZoomMode        =   3
  265.       ZoomMax         =   400
  266.       ZoomMin         =   10
  267.       ZoomStep        =   40
  268.       MouseZoom       =   1
  269.       MouseScroll     =   -1  'True
  270.       MousePage       =   -1  'True
  271.       EmptyColor      =   -2147483636
  272.       TextColor       =   0
  273.       HdrColor        =   0
  274.       BrushColor      =   0
  275.       BrushStyle      =   0
  276.       PenColor        =   0
  277.       PenStyle        =   0
  278.       PenWidth        =   0
  279.       PageBorder      =   0
  280.       Header          =   ""
  281.       Footer          =   ""
  282.       TableSep        =   "|;"
  283.       TableBorder     =   7
  284.       TablePen        =   0
  285.       TablePenLR      =   0
  286.       TablePenTB      =   0
  287.       HTMLStyle       =   1
  288.       Begin VB.Image Image1 
  289.          Height          =   1140
  290.          Left            =   0
  291.          Picture         =   "系统_打印预览.frx":22B4
  292.          Top             =   0
  293.          Visible         =   0   'False
  294.          Width           =   1065
  295.       End
  296.    End
  297.    Begin MSComctlLib.Toolbar YlToolbar 
  298.       Align           =   1  'Align Top
  299.       Height          =   630
  300.       Left            =   0
  301.       TabIndex        =   4
  302.       Top             =   0
  303.       Width           =   10755
  304.       _ExtentX        =   18971
  305.       _ExtentY        =   1111
  306.       ButtonWidth     =   900
  307.       ButtonHeight    =   953
  308.       AllowCustomize  =   0   'False
  309.       Appearance      =   1
  310.       ImageList       =   "ImageList1"
  311.       _Version        =   393216
  312.       BeginProperty Buttons {66833FE8-8583-11D1-B16A-00C0F0283628} 
  313.          NumButtons      =   7
  314.          BeginProperty Button1 {66833FEA-8583-11D1-B16A-00C0F0283628} 
  315.             Caption         =   "打 印"
  316.             Key             =   "dy"
  317.             ImageKey        =   "dy"
  318.          EndProperty
  319.          BeginProperty Button2 {66833FEA-8583-11D1-B16A-00C0F0283628} 
  320.             Style           =   3
  321.          EndProperty
  322.          BeginProperty Button3 {66833FEA-8583-11D1-B16A-00C0F0283628} 
  323.             Caption         =   "上 页"
  324.             Key             =   "sy"
  325.             ImageKey        =   "sy"
  326.          EndProperty
  327.          BeginProperty Button4 {66833FEA-8583-11D1-B16A-00C0F0283628} 
  328.             Caption         =   "下 页"
  329.             Key             =   "xy"
  330.             ImageKey        =   "xy"
  331.          EndProperty
  332.          BeginProperty Button5 {66833FEA-8583-11D1-B16A-00C0F0283628} 
  333.             Style           =   3
  334.          EndProperty
  335.          BeginProperty Button6 {66833FEA-8583-11D1-B16A-00C0F0283628} 
  336.             Caption         =   "帮 助"
  337.             Key             =   "bz"
  338.             ImageKey        =   "bz"
  339.          EndProperty
  340.          BeginProperty Button7 {66833FEA-8583-11D1-B16A-00C0F0283628} 
  341.             Caption         =   "返 回"
  342.             Key             =   "fh"
  343.             ImageKey        =   "tc"
  344.          EndProperty
  345.       EndProperty
  346.    End
  347. End
  348. Attribute VB_Name = "DY_Tybbyldy"
  349. Attribute VB_GlobalNameSpace = False
  350. Attribute VB_Creatable = False
  351. Attribute VB_PredeclaredId = True
  352. Attribute VB_Exposed = False
  353. '*******************************************************
  354. '*    模 块 名 称 :报表打印预览
  355. '*    功 能 描 述 :实现对报表按各种比例的模拟显示
  356. '*    程序员姓名  :张建忠
  357. '*    最后修改人  :张建忠
  358. '*    最后修改时间:2001/06/23
  359. '*    备        注:封版
  360. '*******************************************************
  361. Dim Ylzybl As Double, ylms As Integer                 '预 览 整 页 比 例
  362. Dim Changelock As Boolean                             '程 序 改 变 值 控 制 锁
  363. Private Sub PageHScroll_Change()                      '利用滚动条改变页号
  364.     With Tydy
  365.         If Not Changelock Then
  366.             .PreviewPage = PageHScroll.Value
  367.             If .PreviewPage = 1 Then
  368.                 YlToolbar.Buttons("sy").Enabled = False
  369.             Else
  370.                 YlToolbar.Buttons("sy").Enabled = True
  371.             End If
  372.             If .PreviewPage < .Pagecount Then
  373.                 YlToolbar.Buttons("xy").Enabled = True
  374.             Else
  375.                 YlToolbar.Buttons("xy").Enabled = False
  376.             End If
  377.         End If
  378.         Dqyh = Trim(Str(.PreviewPage))
  379.         Gjyh = "(共计:" + Trim(Str(.Pagecount)) + "页)"
  380.     End With
  381. End Sub
  382. Private Sub Tydy_MouseDown(Button As Integer, Shift As Integer, x As Single, y As Single)
  383.     With Tydy
  384.         If .Zoom <> 100 Then
  385.             .Zoom = 100
  386.             Xsbl.Text = "100%"
  387.         Else
  388.             Changelock = True
  389.             .ZoomMode = ylms
  390.             Select Case .ZoomMode
  391.                 Case zmPageWidth
  392.                     Xsbl.Text = "页宽"
  393.                 Case zmWholePage
  394.                     Xsbl.Text = "整页"
  395.                 Case zmThumbnail
  396.                     Xsbl.Text = "双页"
  397.             End Select
  398.             Changelock = False
  399.         End If
  400.     End With
  401. End Sub
  402. Private Sub Xsbl_Click()                  '调 整 预 览 比 例
  403.     If Changelock Then
  404.         Exit Sub
  405.     End If
  406.     With Tydy
  407.         Select Case Xsbl.Text
  408.             Case "页宽"
  409.                 .ZoomMode = zmPageWidth
  410.                 ylms = .ZoomMode
  411.             Case "整页"
  412.                 .ZoomMode = zmWholePage
  413.                 ylms = .ZoomMode
  414.             Case "双页"
  415.                 .ZoomMode = zmThumbnail
  416.                 ylms = .ZoomMode
  417.             Case Else
  418.                 .Zoom = Val(Mid(Xsbl.Text, 1, Len(Xsbl.Text) - 1))
  419.         End Select
  420.     End With
  421. End Sub
  422. Private Sub Form_Load()
  423.    
  424.     With Tydy
  425.         Ylzybl = .Zoom
  426.         .ZoomMax = 400
  427.         .ZoomMin = 25
  428.     End With
  429.     With Xsbl
  430.         .AddItem "页宽"
  431.         .AddItem "整页"
  432.         .AddItem "双页"
  433.         .AddItem "10%"
  434.         .AddItem "25%"
  435.         .AddItem "50%"
  436.         .AddItem "75%"
  437.         .AddItem "100%"
  438.         .AddItem "150%"
  439.         .AddItem "200%"
  440.         .AddItem "400%"
  441.         Changelock = True
  442.         .Text = "整页"
  443.         ylms = Tydy.ZoomMode
  444.         Changelock = False
  445.     End With
  446. End Sub
  447. Private Sub Qpage()                             '向 前 翻 页
  448.     With Tydy
  449.         If .PreviewPage > 1 Then
  450.             .PreviewPage = .PreviewPage - 1
  451.             If .PreviewPage = 1 Then
  452.                 YlToolbar.Buttons("sy").Enabled = False
  453.             End If
  454.             If .PreviewPage < .Pagecount Then
  455.                 YlToolbar.Buttons("xy").Enabled = True
  456.             End If
  457.             Changelock = True
  458.             PageHScroll.Value = .PreviewPage
  459.             Changelock = False
  460.         End If
  461.     End With
  462. End Sub
  463. Private Sub Hpage()                        '向 后 翻 页
  464.     With Tydy
  465.         If .PreviewPage < .Pagecount Then
  466.             .PreviewPage = .PreviewPage + 1
  467.             If .PreviewPage > 1 Then
  468.                 YlToolbar.Buttons("sy").Enabled = True
  469.             End If
  470.             If .PreviewPage >= .Pagecount Then
  471.                 YlToolbar.Buttons("xy").Enabled = False
  472.             End If
  473.             Changelock = True
  474.             PageHScroll.Value = .PreviewPage
  475.             Changelock = False
  476.         End If
  477.     End With
  478.   
  479. End Sub
  480. Private Sub YlToolbar_ButtonClick(ByVal Button As MSComctlLib.Button)      '点击工具条
  481.     Select Case Button.Key
  482.         Case "dy"
  483.             Call dyscbb
  484.         Case "sy"
  485.             Call Qpage
  486.         Case "xy"
  487.             Call Hpage
  488.         Case "fh"
  489.             Unload Me
  490.         Case "bz"
  491.             Call F1bz
  492.     End Select
  493. End Sub