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