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