⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 graphbar.frm

📁 不错的一个VB菜单设计 界面和功能都不错
💻 FRM
字号:
VERSION 5.00
Object = "{75D4F53D-8785-11D3-93AD-0000832EF44D}#2.4#0"; "FAST2002.ocx"
Begin VB.Form frmGraphBar 
   BorderStyle     =   1  'Fixed Single
   Caption         =   "Graph Bar"
   ClientHeight    =   5340
   ClientLeft      =   45
   ClientTop       =   330
   ClientWidth     =   9675
   Icon            =   "GraphBar.frx":0000
   LinkTopic       =   "Form1"
   MaxButton       =   0   'False
   MinButton       =   0   'False
   ScaleHeight     =   5340
   ScaleWidth      =   9675
   StartUpPosition =   2  'CenterScreen
   Begin VB.CommandButton cmdCopy 
      Caption         =   "Copy GraphBar to Clipboard"
      Height          =   435
      Left            =   60
      TabIndex        =   8
      Top             =   4740
      Width           =   2295
   End
   Begin FLWGraphMath.FWGraphBar objGraphBar 
      Height          =   5055
      Left            =   2430
      TabIndex        =   7
      Top             =   120
      Width           =   7095
      _ExtentX        =   12515
      _ExtentY        =   8916
   End
   Begin VB.CheckBox chkShow 
      Caption         =   "Show legends"
      Height          =   180
      Left            =   240
      TabIndex        =   6
      Top             =   2115
      Width           =   1845
   End
   Begin VB.HScrollBar hscrAngleXY 
      Height          =   240
      LargeChange     =   10
      Left            =   225
      Max             =   60
      SmallChange     =   2
      TabIndex        =   0
      Top             =   360
      Width           =   1860
   End
   Begin VB.HScrollBar hscrAngleYZ 
      Height          =   240
      LargeChange     =   10
      Left            =   225
      Max             =   60
      SmallChange     =   2
      TabIndex        =   1
      Top             =   945
      Width           =   1860
   End
   Begin VB.ComboBox cboStyle 
      Height          =   315
      ItemData        =   "GraphBar.frx":0442
      Left            =   225
      List            =   "GraphBar.frx":046D
      Style           =   2  'Dropdown List
      TabIndex        =   2
      Top             =   1575
      Width           =   1905
   End
   Begin VB.Label lblLabel 
      AutoSize        =   -1  'True
      BackStyle       =   0  'Transparent
      Caption         =   "Angle XY"
      Height          =   195
      Index           =   2
      Left            =   225
      TabIndex        =   5
      Top             =   135
      Width           =   660
   End
   Begin VB.Label lblLabel 
      AutoSize        =   -1  'True
      BackStyle       =   0  'Transparent
      Caption         =   "Angle ZY"
      Height          =   195
      Index           =   1
      Left            =   225
      TabIndex        =   4
      Top             =   720
      Width           =   660
   End
   Begin VB.Label lblLabel 
      AutoSize        =   -1  'True
      BackStyle       =   0  'Transparent
      Caption         =   "Style"
      Height          =   195
      Index           =   0
      Left            =   225
      TabIndex        =   3
      Top             =   1350
      Width           =   345
   End
End
Attribute VB_Name = "frmGraphBar"
Attribute VB_GlobalNameSpace = False
Attribute VB_Creatable = False
Attribute VB_PredeclaredId = True
Attribute VB_Exposed = False
Option Explicit


Private Sub cmdCopy_Click()
  ' you can use Picture property to obtain an image of the
  ' control, for example, to print it.
  Call Clipboard.SetData(objGraphBar.Picture, vbCFDIB)
End Sub

Private Sub Form_Load()
  Dim intInd  As Integer
  Dim objDate As New flwdata.FWDate
  
  Call Randomize
  With objGraphBar
    Call .Create("Graph Title (Monthly)", 12)
    
    chkShow = IIf(.ShowLegends, vbChecked, vbUnchecked)
    
    .Style = FLWGraphMath.flwGraphBars3D
    
    ' serie 1
    With .Add(vbRed, "Serie one")
      For intInd = 1 To 12
        .Value(intInd) = Rnd * 500
      Next
    End With
   
    ' serie 2
    With .Add(vbGreen, "Serie two")
      For intInd = 1 To 12
        .Value(intInd) = Rnd * 400
      Next
    End With
    
    ' serie 3
    With .Add(vbBlue, "Serie three")
      For intInd = 1 To 12
        .Value(intInd) = Rnd * 300
      Next
    End With
  
    .Legends(1) = "January"
    .Legends(2) = "February"
    .Legends(3) = "March"
    .Legends(4) = "April"
    .Legends(5) = "May"
    .Legends(6) = "June"
    .Legends(7) = "July"
    .Legends(8) = "August"
    .Legends(9) = "September"
    .Legends(10) = "October"
    .Legends(11) = "November"
    .Legends(12) = "December"
 
    cboStyle.ListIndex = 0
    hscrAngleXY = .AngleXY
    hscrAngleYZ = .AngleYZ
  End With
End Sub

Private Sub cboStyle_Click()
  Dim blnActive As Boolean
  
  Select Case cboStyle.ListIndex
    Case 0
      objGraphBar.Style = FLWGraphMath.flwGraphBars3D
      blnActive = True
    Case 1
      objGraphBar.Style = FLWGraphMath.flwGraphBarsOneRow3D
      blnActive = True
    Case 2
      objGraphBar.Style = FLWGraphMath.flwGraphBarsAcum3D
      blnActive = True
    Case 3
      objGraphBar.Style = FLWGraphMath.flwGraphZones3D
      blnActive = True
    Case 4
      objGraphBar.Style = FLWGraphMath.flwGraphZonesAcum3D
      blnActive = True
    Case 5
      objGraphBar.Style = FLWGraphMath.flwGraphLines3D
      blnActive = True
    Case 6
      objGraphBar.Style = FLWGraphMath.flwGraphLinesAcum3D
      blnActive = True
    Case 7
      objGraphBar.Style = FLWGraphMath.flwGraphBars2D
      blnActive = False
    Case 8
      objGraphBar.Style = FLWGraphMath.flwGraphBarsAcum2D
      blnActive = False
    Case 9
      objGraphBar.Style = FLWGraphMath.flwGraphLines2D
      blnActive = False
    Case 10
      objGraphBar.Style = FLWGraphMath.flwGraphLinesAcum2D
      blnActive = False
    Case 11
      objGraphBar.Style = FLWGraphMath.flwGraphZones2D
      blnActive = False
    Case 12
      objGraphBar.Style = FLWGraphMath.flwGraphZonesAcum2D
      blnActive = False
  End Select
  
  hscrAngleXY.Enabled = blnActive
  hscrAngleYZ.Enabled = blnActive
  lblLabel(1).Enabled = blnActive
  lblLabel(2).Enabled = blnActive
End Sub

Private Sub hscrAngleXY_Change()
  objGraphBar.AngleXY = hscrAngleXY.Value
End Sub

Private Sub hscrAngleYZ_Change()
  objGraphBar.AngleYZ = hscrAngleYZ.Value
End Sub

Private Sub chkShow_Click()
  objGraphBar.ShowLegends = (chkShow.Value = vbChecked)
End Sub

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -