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

企业管理

开发平台:

Visual Basic

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