上传用户: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      =   1710
  9.    ClientTop       =   1365
  10.    ClientWidth     =   11280
  11.    Icon            =   "系统_图形分析窗体.frx":0000
  12.    LinkTopic       =   "Form1"
  13.    ScaleHeight     =   7590
  14.    ScaleWidth      =   11280
  15.    Begin TeeChart.TChart Txfxchart 
  16.       Height          =   6540
  17.       Left            =   450
  18.       OleObjectBlob   =   "系统_图形分析窗体.frx":08CA
  19.       TabIndex        =   4
  20.       Top             =   600
  21.       Width           =   10740
  22.    End
  23.    Begin VB.CommandButton Command1 
  24.       Caption         =   "Command1"
  25.       Height          =   495
  26.       Left            =   2010
  27.       TabIndex        =   1
  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        =   2
  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           =   19368
  46.             Text            =   "3D效果"
  47.             TextSave        =   "3D效果"
  48.          EndProperty
  49.       EndProperty
  50.    End
  51.    Begin MSComctlLib.Toolbar Toolbar2 
  52.       Align           =   1  'Align Top
  53.       Height          =   555
  54.       Left            =   0
  55.       TabIndex        =   3
  56.       Top             =   0
  57.       Width           =   11280
  58.       _ExtentX        =   19897
  59.       _ExtentY        =   979
  60.       ButtonWidth     =   820
  61.       ButtonHeight    =   926
  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 MSComDlg.CommonDialog CommonDialog1 
  104.          Left            =   6930
  105.          Top             =   30
  106.          _ExtentX        =   847
  107.          _ExtentY        =   847
  108.          _Version        =   393216
  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":097C
  124.                Key             =   ""
  125.             EndProperty
  126.             BeginProperty ListImage2 {2C247F27-8591-11D1-B16A-00C0F0283628} 
  127.                Picture         =   "系统_图形分析窗体.frx":0D16
  128.                Key             =   ""
  129.             EndProperty
  130.             BeginProperty ListImage3 {2C247F27-8591-11D1-B16A-00C0F0283628} 
  131.                Picture         =   "系统_图形分析窗体.frx":10B0
  132.                Key             =   ""
  133.             EndProperty
  134.             BeginProperty ListImage4 {2C247F27-8591-11D1-B16A-00C0F0283628} 
  135.                Picture         =   "系统_图形分析窗体.frx":144A
  136.                Key             =   ""
  137.             EndProperty
  138.             BeginProperty ListImage5 {2C247F27-8591-11D1-B16A-00C0F0283628} 
  139.                Picture         =   "系统_图形分析窗体.frx":17E4
  140.                Key             =   ""
  141.             EndProperty
  142.             BeginProperty ListImage6 {2C247F27-8591-11D1-B16A-00C0F0283628} 
  143.                Picture         =   "系统_图形分析窗体.frx":1B7E
  144.                Key             =   ""
  145.             EndProperty
  146.             BeginProperty ListImage7 {2C247F27-8591-11D1-B16A-00C0F0283628} 
  147.                Picture         =   "系统_图形分析窗体.frx":1F18
  148.                Key             =   "3d"
  149.             EndProperty
  150.             BeginProperty ListImage8 {2C247F27-8591-11D1-B16A-00C0F0283628} 
  151.                Picture         =   "系统_图形分析窗体.frx":22B2
  152.                Key             =   "dy"
  153.             EndProperty
  154.             BeginProperty ListImage9 {2C247F27-8591-11D1-B16A-00C0F0283628} 
  155.                Picture         =   "系统_图形分析窗体.frx":264C
  156.                Key             =   "bz"
  157.             EndProperty
  158.             BeginProperty ListImage10 {2C247F27-8591-11D1-B16A-00C0F0283628} 
  159.                Picture         =   "系统_图形分析窗体.frx":29E6
  160.                Key             =   "fh"
  161.             EndProperty
  162.             BeginProperty ListImage11 {2C247F27-8591-11D1-B16A-00C0F0283628} 
  163.                Picture         =   "系统_图形分析窗体.frx":2D80
  164.                Key             =   "item"
  165.             EndProperty
  166.          EndProperty
  167.       End
  168.    End
  169.    Begin MSComctlLib.Toolbar Toolbar1 
  170.       Align           =   3  'Align Left
  171.       Height          =   6630
  172.       Left            =   0
  173.       TabIndex        =   0
  174.       Top             =   555
  175.       Width           =   420
  176.       _ExtentX        =   741
  177.       _ExtentY        =   11695
  178.       ButtonWidth     =   1138
  179.       ButtonHeight    =   582
  180.       Appearance      =   1
  181.       TextAlignment   =   1
  182.       ImageList       =   "ImageList2"
  183.       DisabledImageList=   "ImageList2"
  184.       HotImageList    =   "ImageList2"
  185.       _Version        =   393216
  186.       BeginProperty Buttons {66833FE8-8583-11D1-B16A-00C0F0283628} 
  187.          NumButtons      =   7
  188.          BeginProperty Button1 {66833FEA-8583-11D1-B16A-00C0F0283628} 
  189.             Key             =   "area"
  190.             ImageIndex      =   1
  191.          EndProperty
  192.          BeginProperty Button2 {66833FEA-8583-11D1-B16A-00C0F0283628} 
  193.             Key             =   "bar"
  194.             ImageIndex      =   2
  195.          EndProperty
  196.          BeginProperty Button3 {66833FEA-8583-11D1-B16A-00C0F0283628} 
  197.             Key             =   "line"
  198.             ImageIndex      =   3
  199.          EndProperty
  200.          BeginProperty Button4 {66833FEA-8583-11D1-B16A-00C0F0283628} 
  201.             Key             =   "pie"
  202.             ImageIndex      =   4
  203.          EndProperty
  204.          BeginProperty Button5 {66833FEA-8583-11D1-B16A-00C0F0283628} 
  205.             Key             =   "horzbar"
  206.             ImageIndex      =   5
  207.          EndProperty
  208.          BeginProperty Button6 {66833FEA-8583-11D1-B16A-00C0F0283628} 
  209.             Key             =   "hilo"
  210.             ImageIndex      =   6
  211.          EndProperty
  212.          BeginProperty Button7 {66833FEA-8583-11D1-B16A-00C0F0283628} 
  213.             Key             =   "gantt"
  214.             Style           =   3
  215.          EndProperty
  216.       EndProperty
  217.    End
  218. End
  219. Attribute VB_Name = "XT_TxfxFrm"
  220. Attribute VB_GlobalNameSpace = False
  221. Attribute VB_Creatable = False
  222. Attribute VB_PredeclaredId = True
  223. Attribute VB_Exposed = False
  224. Dim Tx3d As Boolean                   '图形3D设置
  225. Dim Dqtxlx As String                  '当前分析图类型
  226. Public bbGrid As Object
  227. Public Txcode As String
  228. Private Sub Command1_Click()
  229.     
  230.     With Txfxchart.Aspect
  231.         If .View3D = True Then
  232.             .Zoom = 100
  233.             .Rotation = 345
  234.             .Elevation = 345
  235.             .HorizOffset = 0
  236.             .VertOffset = 0
  237.             .Perspective = 15
  238.             .Orthogonal = True
  239.             .Chart3DPercent = 15
  240.         End If
  241.     End With
  242. End Sub
  243. Private Sub Form_Load()
  244.     
  245.     TeeCommander1.Chart = Txfxchart
  246.     Tx3d = False
  247.     Dqtxlx = "bar"
  248.     StatusBar1.Panels(1).Text = "二维效果"
  249.   
  250. End Sub
  251. Private Sub Form_Resize()
  252. On Error Resume Next
  253. Txfxchart.Width = Me.Width - Txfxchart.Left - 100
  254. Txfxchart.Height = Me.Height - Txfxchart.Top - 400 - StatusBar1.Height
  255. End Sub
  256. Private Sub Form_Unload(Cancel As Integer)
  257. Unload XT_TxItem
  258. End Sub
  259. Private Sub Toolbar1_ButtonClick(ByVal Button As MSComctlLib.Button)           '选择分析图类型
  260.    
  261.     Call Xzsctxlx(Button.Key)
  262.     Dqtxlx = Button.Key
  263. End Sub
  264. Private Sub Toolbar2_ButtonClick(ByVal Button As MSComctlLib.Button)           '菜 单 选 项
  265.     Select Case Button.Key
  266.         Case "lt"                               '视觉效果
  267.             If Tx3d Then
  268.                 Tx3d = False
  269.                 Txfxchart.Aspect.View3D = False
  270.                 Button.Caption = "3D"
  271.                 StatusBar1.Panels(1).Text = "二维效果"
  272.             Else
  273.                 Tx3d = True
  274.                 Button.Caption = "2D"
  275.                 Txfxchart.Aspect.View3D = True
  276.                 StatusBar1.Panels(1).Text = "三维效果"
  277.             End If
  278.         Case "dy"                                    '打 印
  279.             With Txfxchart
  280.                 
  281.             On Error GoTo Cwcl2:
  282.                
  283.                .Printer.ShowPreview
  284.             
  285.             End With
  286. Cwcl2:
  287.             Exit Sub
  288.         Case "item"
  289.             Call Txfxbb(bbGrid, Txcode)
  290.         Case "tc"
  291.             Unload Me
  292.     End Select
  293. End Sub
  294. Private Sub Xzsctxlx(Txlx As String)                           '选择分析图类型
  295.     
  296.     Dim i As Integer
  297.     With Txfxchart
  298.             Select Case Txlx
  299.                 Case "area"
  300.                     For i = 0 To .SeriesCount - 1
  301.                         .ChangeSeriesType i, scArea
  302.                     Next i
  303.                 Case "bar"
  304.                     For i = 0 To .SeriesCount - 1
  305.                         .ChangeSeriesType i, scBar
  306.                     Next i
  307.                 Case "line"
  308.                     For i = 0 To .SeriesCount - 1
  309.                         .ChangeSeriesType i, scLine
  310.                     Next i
  311.                 Case "step"
  312.                     'For i = 0 To .SeriesCount - 1
  313.                         '.ChangeSeriesType i, scShape
  314.                     'Next i
  315.                 Case "combination"
  316.                     'For i = 0 To .SeriesCount - 1
  317.                     '   .ChangeSeriesType i, scContour
  318.                     'Next i
  319.                 Case "pie"
  320.                     For i = 0 To .SeriesCount - 1
  321.                         .ChangeSeriesType i, scPie
  322.                     Next i
  323.                 Case "horzbar"
  324.                     For i = 0 To .SeriesCount - 1
  325.                         .ChangeSeriesType i, scHorizBar
  326.                     Next i
  327.                 Case "hilo"
  328.                     For i = 0 To .SeriesCount - 1
  329.                         .ChangeSeriesType i, scPoint
  330.                     Next i
  331.                 Case "gantt"
  332.                     For i = 0 To .SeriesCount - 1
  333.                         .ChangeSeriesType i, scFastLine
  334.                     Next i
  335.             End Select
  336.     End With
  337. End Sub
  338. Private Sub Txfxchart_OnSeriesBeforeDrawValues(ByVal SeriesIndex As Long)
  339.     
  340.     With Txfxchart
  341.         If .Series(SeriesIndex).SeriesType = scPie Then
  342.             Select Case SeriesIndex
  343.                 Case 0: .ChartRect 0, 0, .Canvas.Width * 6 / 16, .Canvas.Height / 2
  344.                 Case 1: .ChartRect .Canvas.Width * 5 / 16, 0, .Canvas.Width * 11 / 16, .Canvas.Height / 2
  345.                 Case 2: .ChartRect 0, .Canvas.Height / 2, .Canvas.Width * 6 / 16, .Canvas.Height
  346.                 Case 3: .ChartRect .Canvas.Width * 5 / 16, .Canvas.Height / 2, .Canvas.Width * 11 / 16, .Canvas.Height
  347.                 Case 4: .ChartRect .Canvas.Width * 9 / 16, .Canvas.Height / 5, .Canvas.Width, .Canvas.Height * 4 / 5
  348.             End Select
  349.         End If
  350.     End With
  351. End Sub