上传用户: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     =   10755
  12.    HelpContextID   =   1501003
  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            =   1050
  45.          TabIndex        =   9
  46.          Top             =   30
  47.          Width           =   855
  48.       End
  49.       Begin VB.Label Gjyh 
  50.          ForeColor       =   &H00000000&
  51.          Height          =   300
  52.          Left            =   2460
  53.          TabIndex        =   8
  54.          Top             =   30
  55.          Width           =   1185
  56.       End
  57.       Begin VB.Label Dqyh 
  58.          ForeColor       =   &H00FF0000&
  59.          Height          =   300
  60.          Left            =   1890
  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           =   10755
  191.       _ExtentX        =   18971
  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           =   13335
  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            =   0
  315.          Picture         =   "系统_打印预览.frx":2244
  316.          Top             =   0
  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           =   10755
  328.       _ExtentX        =   18971
  329.       _ExtentY        =   1111
  330.       ButtonWidth     =   900
  331.       ButtonHeight    =   953
  332.       AllowCustomize  =   0   'False
  333.       Appearance      =   1
  334.       ImageList       =   "ImageList1"
  335.       _Version        =   393216
  336.       BeginProperty Buttons {66833FE8-8583-11D1-B16A-00C0F0283628} 
  337.          NumButtons      =   7
  338.          BeginProperty Button1 {66833FEA-8583-11D1-B16A-00C0F0283628} 
  339.             Caption         =   "打 印"
  340.             Key             =   "dy"
  341.             ImageKey        =   "dy"
  342.          EndProperty
  343.          BeginProperty Button2 {66833FEA-8583-11D1-B16A-00C0F0283628} 
  344.             Style           =   3
  345.          EndProperty
  346.          BeginProperty Button3 {66833FEA-8583-11D1-B16A-00C0F0283628} 
  347.             Caption         =   "上 页"
  348.             Key             =   "sy"
  349.             ImageKey        =   "sy"
  350.          EndProperty
  351.          BeginProperty Button4 {66833FEA-8583-11D1-B16A-00C0F0283628} 
  352.             Caption         =   "下 页"
  353.             Key             =   "xy"
  354.             ImageKey        =   "xy"
  355.          EndProperty
  356.          BeginProperty Button5 {66833FEA-8583-11D1-B16A-00C0F0283628} 
  357.             Style           =   3
  358.          EndProperty
  359.          BeginProperty Button6 {66833FEA-8583-11D1-B16A-00C0F0283628} 
  360.             Caption         =   "帮 助"
  361.             Key             =   "bz"
  362.             ImageKey        =   "bz"
  363.          EndProperty
  364.          BeginProperty Button7 {66833FEA-8583-11D1-B16A-00C0F0283628} 
  365.             Caption         =   "返 回"
  366.             Key             =   "fh"
  367.             ImageKey        =   "tc"
  368.          EndProperty
  369.       EndProperty
  370.    End
  371. End
  372. Attribute VB_Name = "DY_Tybbyldy"
  373. Attribute VB_GlobalNameSpace = False
  374. Attribute VB_Creatable = False
  375. Attribute VB_PredeclaredId = True
  376. Attribute VB_Exposed = False
  377. '*******************************************************
  378. '*    模 块 名 称 :报表打印预览
  379. '*    功 能 描 述 :实现对报表按各种比例的模拟显示
  380. '*    程序员姓名  :张建忠
  381. '*    最后修改人  :张建忠
  382. '*    最后修改时间:2001/06/23
  383. '*    备        注:封版
  384. '*******************************************************
  385. Dim Ylzybl As Double, ylms As Integer                 '预 览 整 页 比 例
  386. Dim Changelock As Boolean                             '程 序 改 变 值 控 制 锁
  387. Private Sub PageHScroll_Change()                      '利用滚动条改变页号
  388.     With Tydy
  389.         If Not Changelock Then
  390.             .PreviewPage = PageHScroll.Value
  391.             If .PreviewPage = 1 Then
  392.                 YlToolbar.Buttons("sy").Enabled = False
  393.             Else
  394.                 YlToolbar.Buttons("sy").Enabled = True
  395.             End If
  396.             If .PreviewPage < .Pagecount Then
  397.                 YlToolbar.Buttons("xy").Enabled = True
  398.             Else
  399.                 YlToolbar.Buttons("xy").Enabled = False
  400.             End If
  401.         End If
  402.         Dqyh = Trim(Str(.PreviewPage))
  403.         Gjyh = "(共计:" + Trim(Str(.Pagecount)) + "页)"
  404.     End With
  405. End Sub
  406. Private Sub Tydy_MouseDown(Button As Integer, Shift As Integer, x As Single, y As Single)
  407.     With Tydy
  408.         If .Zoom <> 100 Then
  409.             .Zoom = 100
  410.             Xsbl.Text = "100%"
  411.         Else
  412.             Changelock = True
  413.             .ZoomMode = ylms
  414.             Select Case .ZoomMode
  415.                 Case zmPageWidth
  416.                     Xsbl.Text = "页宽"
  417.                 Case zmWholePage
  418.                     Xsbl.Text = "整页"
  419.                 Case zmThumbnail
  420.                     Xsbl.Text = "双页"
  421.             End Select
  422.             Changelock = False
  423.         End If
  424.     End With
  425. End Sub
  426. Private Sub Xsbl_Click()                  '调 整 预 览 比 例
  427.     If Changelock Then
  428.         Exit Sub
  429.     End If
  430.     With Tydy
  431.         Select Case Xsbl.Text
  432.             Case "页宽"
  433.                 .ZoomMode = zmPageWidth
  434.                 ylms = .ZoomMode
  435.             Case "整页"
  436.                 .ZoomMode = zmWholePage
  437.                 ylms = .ZoomMode
  438.             Case "双页"
  439.                 .ZoomMode = zmThumbnail
  440.                 ylms = .ZoomMode
  441.             Case Else
  442.                 .Zoom = Val(Mid(Xsbl.Text, 1, Len(Xsbl.Text) - 1))
  443.         End Select
  444.     End With
  445. End Sub
  446. Private Sub Form_Load()
  447.    
  448.     With Tydy
  449.         Ylzybl = .Zoom
  450.         .ZoomMax = 400
  451.         .ZoomMin = 25
  452.     End With
  453.     With Xsbl
  454.         .AddItem "页宽"
  455.         .AddItem "整页"
  456.         .AddItem "双页"
  457.         .AddItem "10%"
  458.         .AddItem "25%"
  459.         .AddItem "50%"
  460.         .AddItem "75%"
  461.         .AddItem "100%"
  462.         .AddItem "150%"
  463.         .AddItem "200%"
  464.         .AddItem "400%"
  465.         Changelock = True
  466.         .Text = "整页"
  467.         ylms = Tydy.ZoomMode
  468.         Changelock = False
  469.     End With
  470. End Sub
  471. Private Sub Qpage()                             '向 前 翻 页
  472.     With Tydy
  473.         If .PreviewPage > 1 Then
  474.             .PreviewPage = .PreviewPage - 1
  475.             If .PreviewPage = 1 Then
  476.                 YlToolbar.Buttons("sy").Enabled = False
  477.             End If
  478.             If .PreviewPage < .Pagecount Then
  479.                 YlToolbar.Buttons("xy").Enabled = True
  480.             End If
  481.             Changelock = True
  482.             PageHScroll.Value = .PreviewPage
  483.             Changelock = False
  484.         End If
  485.     End With
  486. End Sub
  487. Private Sub Hpage()                        '向 后 翻 页
  488.     With Tydy
  489.         If .PreviewPage < .Pagecount Then
  490.             .PreviewPage = .PreviewPage + 1
  491.             If .PreviewPage > 1 Then
  492.                 YlToolbar.Buttons("sy").Enabled = True
  493.             End If
  494.             If .PreviewPage >= .Pagecount Then
  495.                 YlToolbar.Buttons("xy").Enabled = False
  496.             End If
  497.             Changelock = True
  498.             PageHScroll.Value = .PreviewPage
  499.             Changelock = False
  500.         End If
  501.     End With
  502.   
  503. End Sub
  504. Private Sub YlToolbar_ButtonClick(ByVal Button As MSComctlLib.Button)      '点击工具条
  505.     Select Case Button.Key
  506.         Case "dy"
  507.             Call dyscbb
  508.         Case "sy"
  509.             Call Qpage
  510.         Case "xy"
  511.             Call Hpage
  512.         Case "fh"
  513.             Unload Me
  514.         Case "bz"
  515.             Call F1bz
  516.     End Select
  517. End Sub