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

企业管理

开发平台:

Visual Basic

  1. VERSION 5.00
  2. Object = "{831FDD16-0C5C-11D2-A9FC-0000F8754DA1}#2.0#0"; "MSCOMCTL.OCX"
  3. Object = "{F9043C88-F6F2-101A-A3C9-08002B2F49FB}#1.2#0"; "comdlg32.ocx"
  4. Object = "{008BBE7B-C096-11D0-B4E3-00A0C901D681}#1.0#0"; "teechart.ocx"
  5. Begin VB.Form XT_TxfxFrm 
  6.    Caption         =   "图形分析"
  7.    ClientHeight    =   7590
  8.    ClientLeft      =   315
  9.    ClientTop       =   495
  10.    ClientWidth     =   11280
  11.    Icon            =   "系统_图形分析窗体.frx":0000
  12.    LinkTopic       =   "Form1"
  13.    ScaleHeight     =   7590
  14.    ScaleWidth      =   11280
  15.    StartUpPosition =   1  '所有者中心
  16.    Begin TeeChart.TChart Txfxchart 
  17.       Height          =   6555
  18.       Left            =   420
  19.       TabIndex        =   5
  20.       Top             =   570
  21.       Width           =   10845
  22.    End
  23.    Begin VB.CommandButton Command1 
  24.       Caption         =   "Command1"
  25.       Height          =   495
  26.       Left            =   2010
  27.       TabIndex        =   4
  28.       Top             =   930
  29.       Width           =   1065
  30.    End
  31.    Begin MSComctlLib.StatusBar StatusBar1 
  32.       Align           =   2  'Align Bottom
  33.       Height          =   405
  34.       Left            =   0
  35.       TabIndex        =   1
  36.       Top             =   7185
  37.       Width           =   11280
  38.       _ExtentX        =   19897
  39.       _ExtentY        =   714
  40.       _Version        =   393216
  41.       BeginProperty Panels {8E3867A5-8586-11D1-B16A-00C0F0283628} 
  42.          NumPanels       =   1
  43.          BeginProperty Panel1 {8E3867AB-8586-11D1-B16A-00C0F0283628} 
  44.             AutoSize        =   1
  45.             Object.Width           =   19394
  46.             Text            =   "3D效果"
  47.             TextSave        =   "3D效果"
  48.          EndProperty
  49.       EndProperty
  50.    End
  51.    Begin MSComctlLib.Toolbar Toolbar2 
  52.       Align           =   1  'Align Top
  53.       Height          =   570
  54.       Left            =   0
  55.       TabIndex        =   2
  56.       Top             =   0
  57.       Width           =   11280
  58.       _ExtentX        =   19897
  59.       _ExtentY        =   1005
  60.       ButtonWidth     =   820
  61.       ButtonHeight    =   953
  62.       Appearance      =   1
  63.       Style           =   1
  64.       ImageList       =   "ImageList2"
  65.       DisabledImageList=   "ImageList2"
  66.       HotImageList    =   "ImageList2"
  67.       _Version        =   393216
  68.       BeginProperty Buttons {66833FE8-8583-11D1-B16A-00C0F0283628} 
  69.          NumButtons      =   7
  70.          BeginProperty Button1 {66833FEA-8583-11D1-B16A-00C0F0283628} 
  71.             Caption         =   "打印"
  72.             Key             =   "dy"
  73.             ImageKey        =   "dy"
  74.          EndProperty
  75.          BeginProperty Button2 {66833FEA-8583-11D1-B16A-00C0F0283628} 
  76.             Style           =   3
  77.          EndProperty
  78.          BeginProperty Button3 {66833FEA-8583-11D1-B16A-00C0F0283628} 
  79.             Caption         =   "3D"
  80.             Key             =   "lt"
  81.             ImageKey        =   "3d"
  82.          EndProperty
  83.          BeginProperty Button4 {66833FEA-8583-11D1-B16A-00C0F0283628} 
  84.             Caption         =   "项目"
  85.             Key             =   "item"
  86.             ImageKey        =   "item"
  87.          EndProperty
  88.          BeginProperty Button5 {66833FEA-8583-11D1-B16A-00C0F0283628} 
  89.             Style           =   3
  90.          EndProperty
  91.          BeginProperty Button6 {66833FEA-8583-11D1-B16A-00C0F0283628} 
  92.             Caption         =   "帮助"
  93.             Key             =   "bz"
  94.             ImageKey        =   "bz"
  95.          EndProperty
  96.          BeginProperty Button7 {66833FEA-8583-11D1-B16A-00C0F0283628} 
  97.             Caption         =   "退出"
  98.             Key             =   "tc"
  99.             ImageKey        =   "fh"
  100.          EndProperty
  101.       EndProperty
  102.       BorderStyle     =   1
  103.       Begin TeeChart.TeeCommander TeeCommander1 
  104.          Height          =   585
  105.          Left            =   9450
  106.          TabIndex        =   3
  107.          Top             =   -30
  108.          Width           =   1815
  109.       End
  110.       Begin MSComctlLib.ImageList ImageList2 
  111.          Left            =   6210
  112.          Top             =   -30
  113.          _ExtentX        =   1005
  114.          _ExtentY        =   1005
  115.          BackColor       =   -2147483643
  116.          ImageWidth      =   16
  117.          ImageHeight     =   16
  118.          MaskColor       =   12632256
  119.          _Version        =   393216
  120.          BeginProperty Images {2C247F25-8591-11D1-B16A-00C0F0283628} 
  121.             NumListImages   =   11
  122.             BeginProperty ListImage1 {2C247F27-8591-11D1-B16A-00C0F0283628} 
  123.                Picture         =   "系统_图形分析窗体.frx":067E
  124.                Key             =   ""
  125.             EndProperty
  126.             BeginProperty ListImage2 {2C247F27-8591-11D1-B16A-00C0F0283628} 
  127.                Picture         =   "系统_图形分析窗体.frx":0A18
  128.                Key             =   ""
  129.             EndProperty
  130.             BeginProperty ListImage3 {2C247F27-8591-11D1-B16A-00C0F0283628} 
  131.                Picture         =   "系统_图形分析窗体.frx":0DB2
  132.                Key             =   ""
  133.             EndProperty
  134.             BeginProperty ListImage4 {2C247F27-8591-11D1-B16A-00C0F0283628} 
  135.                Picture         =   "系统_图形分析窗体.frx":114C
  136.                Key             =   ""
  137.             EndProperty
  138.             BeginProperty ListImage5 {2C247F27-8591-11D1-B16A-00C0F0283628} 
  139.                Picture         =   "系统_图形分析窗体.frx":14E6
  140.                Key             =   ""
  141.             EndProperty
  142.             BeginProperty ListImage6 {2C247F27-8591-11D1-B16A-00C0F0283628} 
  143.                Picture         =   "系统_图形分析窗体.frx":1880
  144.                Key             =   ""
  145.             EndProperty
  146.             BeginProperty ListImage7 {2C247F27-8591-11D1-B16A-00C0F0283628} 
  147.                Picture         =   "系统_图形分析窗体.frx":1C1A
  148.                Key             =   "3d"
  149.             EndProperty
  150.             BeginProperty ListImage8 {2C247F27-8591-11D1-B16A-00C0F0283628} 
  151.                Picture         =   "系统_图形分析窗体.frx":1FB4
  152.                Key             =   "dy"
  153.             EndProperty
  154.             BeginProperty ListImage9 {2C247F27-8591-11D1-B16A-00C0F0283628} 
  155.                Picture         =   "系统_图形分析窗体.frx":234E
  156.                Key             =   "bz"
  157.             EndProperty
  158.             BeginProperty ListImage10 {2C247F27-8591-11D1-B16A-00C0F0283628} 
  159.                Picture         =   "系统_图形分析窗体.frx":26E8
  160.                Key             =   "fh"
  161.             EndProperty
  162.             BeginProperty ListImage11 {2C247F27-8591-11D1-B16A-00C0F0283628} 
  163.                Picture         =   "系统_图形分析窗体.frx":2A82
  164.                Key             =   "item"
  165.             EndProperty
  166.          EndProperty
  167.       End
  168.       Begin MSComDlg.CommonDialog CommonDialog1 
  169.          Left            =   6930
  170.          Top             =   30
  171.          _ExtentX        =   847
  172.          _ExtentY        =   847
  173.          _Version        =   393216
  174.       End
  175.    End
  176.    Begin MSComctlLib.Toolbar Toolbar1 
  177.       Align           =   3  'Align Left
  178.       Height          =   6615
  179.       Left            =   0
  180.       TabIndex        =   0
  181.       Top             =   570
  182.       Width           =   420
  183.       _ExtentX        =   741
  184.       _ExtentY        =   11668
  185.       ButtonWidth     =   1138
  186.       ButtonHeight    =   582
  187.       Appearance      =   1
  188.       TextAlignment   =   1
  189.       ImageList       =   "ImageList2"
  190.       DisabledImageList=   "ImageList2"
  191.       HotImageList    =   "ImageList2"
  192.       _Version        =   393216
  193.       BeginProperty Buttons {66833FE8-8583-11D1-B16A-00C0F0283628} 
  194.          NumButtons      =   7
  195.          BeginProperty Button1 {66833FEA-8583-11D1-B16A-00C0F0283628} 
  196.             Key             =   "area"
  197.             ImageIndex      =   1
  198.          EndProperty
  199.          BeginProperty Button2 {66833FEA-8583-11D1-B16A-00C0F0283628} 
  200.             Key             =   "bar"
  201.             ImageIndex      =   2
  202.          EndProperty
  203.          BeginProperty Button3 {66833FEA-8583-11D1-B16A-00C0F0283628} 
  204.             Key             =   "line"
  205.             ImageIndex      =   3
  206.          EndProperty
  207.          BeginProperty Button4 {66833FEA-8583-11D1-B16A-00C0F0283628} 
  208.             Key             =   "pie"
  209.             ImageIndex      =   4
  210.          EndProperty
  211.          BeginProperty Button5 {66833FEA-8583-11D1-B16A-00C0F0283628} 
  212.             Key             =   "horzbar"
  213.             ImageIndex      =   5
  214.          EndProperty
  215.          BeginProperty Button6 {66833FEA-8583-11D1-B16A-00C0F0283628} 
  216.             Key             =   "hilo"
  217.             ImageIndex      =   6
  218.          EndProperty
  219.          BeginProperty Button7 {66833FEA-8583-11D1-B16A-00C0F0283628} 
  220.             Key             =   "gantt"
  221.             Style           =   3
  222.          EndProperty
  223.       EndProperty
  224.    End
  225. End
  226. Attribute VB_Name = "XT_TxfxFrm"
  227. Attribute VB_GlobalNameSpace = False
  228. Attribute VB_Creatable = False
  229. Attribute VB_PredeclaredId = True
  230. Attribute VB_Exposed = False
  231. Dim Tx3d As Boolean                   '图形3D设置
  232. Dim Dqtxlx As String                  '当前分析图类型
  233. Public bbGrid As Object
  234. Public Txcode As String
  235. Private Sub Command1_Click()
  236.     
  237.     With Txfxchart.Aspect
  238.         If .View3d = True Then
  239.             .Zoom = 100
  240.             .Rotation = 345
  241.             .Elevation = 345
  242.             .HorizOffset = 0
  243.             .VertOffset = 0
  244.             .Perspective = 15
  245.             .Orthogonal = True
  246.             .Chart3DPercent = 15
  247.         End If
  248.     End With
  249. End Sub
  250. Private Sub Form_Load()
  251.     
  252.     TeeCommander1.Chart = Txfxchart
  253.     Tx3d = False
  254.     Dqtxlx = "bar"
  255.     StatusBar1.Panels(1).Text = "二维效果"
  256.   
  257. End Sub
  258. Private Sub Form_Resize()
  259. On Error Resume Next
  260. Txfxchart.Width = Me.Width - Txfxchart.Left - 100
  261. Txfxchart.Height = Me.Height - Txfxchart.Top - 400 - StatusBar1.Height
  262. End Sub
  263. Private Sub Form_Unload(Cancel As Integer)
  264. Unload XT_TxItem
  265. End Sub
  266. Private Sub Toolbar1_ButtonClick(ByVal Button As MSComctlLib.Button)           '选择分析图类型
  267.    
  268.     Call Xzsctxlx(Button.Key)
  269.     Dqtxlx = Button.Key
  270. End Sub
  271. Private Sub Toolbar2_ButtonClick(ByVal Button As MSComctlLib.Button)           '菜 单 选 项
  272.     Select Case Button.Key
  273.         Case "lt"                               '视觉效果
  274.             If Tx3d Then
  275.                 Tx3d = False
  276.                 Txfxchart.Aspect.View3d = False
  277.                 Button.Caption = "3D"
  278.                 StatusBar1.Panels(1).Text = "二维效果"
  279.             Else
  280.                 Tx3d = True
  281.                 Button.Caption = "2D"
  282.                 Txfxchart.Aspect.View3d = True
  283.                 StatusBar1.Panels(1).Text = "三维效果"
  284.             End If
  285.         Case "dy"                                    '打 印
  286.             With Txfxchart
  287.                 
  288.             On Error GoTo Cwcl2:
  289.                
  290.                .Printer.ShowPreview
  291.             
  292.             End With
  293. Cwcl2:
  294.             Exit Sub
  295.         Case "item"
  296.             Call Txfxbb(bbGrid, Txcode)
  297.         Case "bz"
  298.             XT_TxfxFrm.SetFocus
  299.             Call F1bz
  300.         Case "tc"
  301.             Unload Me
  302.     End Select
  303. End Sub
  304. Private Sub Xzsctxlx(Txlx As String)                           '选择分析图类型
  305.     
  306.     Dim i As Integer
  307.     With Txfxchart
  308.             Select Case Txlx
  309.                 Case "area"
  310.                     For i = 0 To .SeriesCount - 1
  311.                         .ChangeSeriesType i, scArea
  312.                     Next i
  313.                 Case "bar"
  314.                     For i = 0 To .SeriesCount - 1
  315.                         .ChangeSeriesType i, scBar
  316.                     Next i
  317.                 Case "line"
  318.                     For i = 0 To .SeriesCount - 1
  319.                         .ChangeSeriesType i, scLine
  320.                     Next i
  321.                 Case "step"
  322.                     'For i = 0 To .SeriesCount - 1
  323.                         '.ChangeSeriesType i, scShape
  324.                     'Next i
  325.                 Case "combination"
  326.                     'For i = 0 To .SeriesCount - 1
  327.                     '   .ChangeSeriesType i, scContour
  328.                     'Next i
  329.                 Case "pie"
  330.                     For i = 0 To .SeriesCount - 1
  331.                         .ChangeSeriesType i, scPie
  332.                     Next i
  333.                 Case "horzbar"
  334.                     For i = 0 To .SeriesCount - 1
  335.                         .ChangeSeriesType i, scHorizBar
  336.                     Next i
  337.                 Case "hilo"
  338.                     For i = 0 To .SeriesCount - 1
  339.                         .ChangeSeriesType i, scPoint
  340.                     Next i
  341.                 Case "gantt"
  342.                     For i = 0 To .SeriesCount - 1
  343.                         .ChangeSeriesType i, scFastLine
  344.                     Next i
  345.             End Select
  346.     End With
  347. End Sub
  348. Private Sub Txfxchart_OnSeriesBeforeDrawValues(ByVal SeriesIndex As Long)
  349.     
  350.     With Txfxchart
  351.         If .Series(SeriesIndex).SeriesType = scPie Then
  352.             Select Case SeriesIndex
  353.                 Case 0: .ChartRect 0, 0, .Canvas.Width * 6 / 16, .Canvas.Height / 2
  354.                 Case 1: .ChartRect .Canvas.Width * 5 / 16, 0, .Canvas.Width * 11 / 16, .Canvas.Height / 2
  355.                 Case 2: .ChartRect 0, .Canvas.Height / 2, .Canvas.Width * 6 / 16, .Canvas.Height
  356.                 Case 3: .ChartRect .Canvas.Width * 5 / 16, .Canvas.Height / 2, .Canvas.Width * 11 / 16, .Canvas.Height
  357.                 Case 4: .ChartRect .Canvas.Width * 9 / 16, .Canvas.Height / 5, .Canvas.Width, .Canvas.Height * 4 / 5
  358.             End Select
  359.         End If
  360.     End With
  361. End Sub