📄 legendstyle.frm
字号:
VERSION 5.00
Begin VB.Form LegendStyle
BorderStyle = 3 'Fixed Dialog
Caption = "Legend Style"
ClientHeight = 2985
ClientLeft = 1140
ClientTop = 1515
ClientWidth = 5925
Icon = "LegendStyle.frx":0000
LinkTopic = "Form1"
MaxButton = 0 'False
MinButton = 0 'False
PaletteMode = 1 'UseZOrder
ScaleHeight = 2985
ScaleWidth = 5925
ShowInTaskbar = 0 'False
Begin VB.CheckBox ckCurrency
Caption = "Use currency &format"
Height = 255
Left = 2220
TabIndex = 4
Top = 660
Width = 1935
End
Begin VB.CommandButton cmdSubTitleStyle
Caption = "Aa"
Height = 495
Left = 5160
TabIndex = 10
Top = 1620
Width = 555
End
Begin VB.TextBox editSubTitle
Height = 315
Left = 1800
TabIndex = 9
Top = 1740
Width = 3195
End
Begin VB.CheckBox ckNewSubTitle
Caption = "Override s&ubtitle:"
Height = 255
Left = 180
TabIndex = 8
Top = 1800
Width = 1515
End
Begin VB.CommandButton cmdTitleStyle
Caption = "Aa"
Height = 495
Left = 5160
TabIndex = 7
Top = 1020
Width = 555
End
Begin VB.TextBox editTitle
Height = 315
Left = 1800
TabIndex = 6
Top = 1140
Width = 3195
End
Begin VB.CheckBox ckNewTitle
Caption = "Override &title:"
Height = 255
Left = 180
TabIndex = 5
Top = 1200
Width = 1335
End
Begin VB.CheckBox ckVisible
Caption = "&Show legend"
Height = 255
Left = 180
TabIndex = 0
Top = 180
Width = 1575
End
Begin VB.CommandButton cmdFontStyle
Caption = "Aa"
Height = 495
Left = 3840
TabIndex = 2
Top = 60
Width = 555
End
Begin VB.CheckBox ckCompact
Caption = "Com&pact legend"
Height = 255
Left = 180
TabIndex = 3
Top = 660
Width = 1575
End
Begin VB.CommandButton cmdCancel
Cancel = -1 'True
Caption = "&Cancel"
Height = 375
Left = 3120
TabIndex = 11
Top = 2460
Width = 1215
End
Begin VB.CommandButton cmdOk
Caption = "&OK"
Default = -1 'True
Height = 375
Left = 1680
TabIndex = 12
Top = 2460
Width = 1215
End
Begin VB.Label lblTextStyle
Caption = "&Body text style:"
Height = 255
Left = 2220
TabIndex = 1
Top = 180
Width = 1275
End
End
Attribute VB_Name = "LegendStyle"
Attribute VB_GlobalNameSpace = False
Attribute VB_Creatable = False
Attribute VB_PredeclaredId = True
Attribute VB_Exposed = False
Option Explicit
' This sample application and corresponding sample code is provided
' for example purposes only. It has not undergone rigorous testing
' and as such should not be shipped as part of a final application
' without extensive testing on the part of the organization releasing
' the end-user product.
Public bCompact As Boolean, bVisible As Boolean, bCurrency As Boolean
Public bOverrideTitle As Boolean, bOverrideSubTitle As Boolean
Public sTitle As String, sSubTitle As String
Public bLegendSet As Boolean, bFirst As Boolean
Dim bTheme As Boolean, gTheme As Theme
Public Sub Activate(Optional tTheme)
If Not bFirst Then
bFirst = True
bVisible = True
bCompact = True
End If
If bVisible Then
ckVisible.Value = 1
Else
ckVisible.Value = 0
End If
If bCompact Then
ckCompact.Value = 1
Else
ckCompact.Value = 0
End If
If bCurrency Then
ckCurrency.Value = 1
Else
ckCurrency.Value = 0
End If
If bOverrideTitle Then
ckNewTitle.Value = 1
Else
ckNewTitle.Value = 0
End If
If bOverrideSubTitle Then
ckNewSubTitle.Value = 1
Else
ckNewSubTitle.Value = 0
End If
editTitle.Text = sTitle
editSubTitle.Text = sSubTitle
If Not IsMissing(tTheme) Then
Set gTheme = tTheme
bTheme = True
Else
Set gTheme = Nothing
bTheme = False
End If
ckVisible_Click
ckCompact_Click
ckNewTitle_Click
ckNewSubTitle_Click
FormToCenter hWnd
Show 1
End Sub
Private Sub ckCompact_Click()
If ckCompact.Value = 1 Then
ckNewSubTitle.Enabled = False
editSubTitle.Enabled = False
cmdSubTitleStyle.Enabled = False
Else
ckNewSubTitle.Enabled = True
editSubTitle.Enabled = (ckNewSubTitle.Value = 1)
cmdSubTitleStyle.Enabled = editSubTitle.Enabled
End If
End Sub
Private Sub ckNewSubTitle_Click()
If ckNewSubTitle.Value = 1 Then
editSubTitle.Enabled = True
cmdSubTitleStyle.Enabled = bTheme
Else
editSubTitle.Enabled = False
cmdSubTitleStyle.Enabled = False
End If
End Sub
Private Sub ckNewTitle_Click()
If ckNewTitle.Value = 1 Then
editTitle.Enabled = True
cmdTitleStyle.Enabled = bTheme
Else
editTitle.Enabled = False
cmdTitleStyle.Enabled = False
End If
End Sub
Private Sub ckVisible_Click()
If ckVisible.Value = 1 Then
ckCompact.Enabled = True
ckCurrency.Enabled = True
lblTextStyle.Enabled = True
ckNewTitle.Enabled = True
editTitle.Enabled = (ckNewTitle.Value = 1)
ckNewSubTitle.Enabled = True
editSubTitle.Enabled = (ckNewSubTitle.Value = 1)
If bTheme Then
cmdFontStyle.Enabled = True
cmdTitleStyle.Enabled = editTitle.Enabled
cmdSubTitleStyle.Enabled = editSubTitle.Enabled
Else
cmdFontStyle.Enabled = False
cmdTitleStyle.Enabled = False
cmdSubTitleStyle.Enabled = False
End If
Else
ckCompact.Enabled = False
ckCurrency.Enabled = False
lblTextStyle.Enabled = False
cmdFontStyle.Enabled = False
ckNewTitle.Enabled = False
editTitle.Enabled = False
cmdTitleStyle.Enabled = False
ckNewSubTitle.Enabled = False
editSubTitle.Enabled = False
cmdSubTitleStyle.Enabled = False
End If
End Sub
Private Sub cmdCancel_Click()
Hide
End Sub
Private Sub cmdFontStyle_Click()
gTheme.Legend.BodyTextStyle.PickText
End Sub
Private Sub cmdOk_Click()
bCompact = (ckCompact.Value = 1)
bVisible = (ckVisible.Value = 1)
bCurrency = (ckCurrency.Value = 1)
bOverrideTitle = (ckNewTitle.Value = 1)
bOverrideSubTitle = (ckNewSubTitle.Value = 1)
sTitle = editTitle.Text
sSubTitle = editSubTitle.Text
bLegendSet = True
Hide
If bTheme Then
With gTheme.Legend
If .Visible <> bVisible Then
.Visible = bVisible
End If
.Compact = bCompact
.CurrencyFormat = bCurrency
If bCompact Then
If bOverrideTitle Then
.CompactTitle = sTitle
End If
Else
If bOverrideTitle Then
.Title = sTitle
End If
If bOverrideSubTitle Then
.SubTitle = sSubTitle
End If
End If
End With
End If
End Sub
Private Sub cmdSubTitleStyle_Click()
gTheme.Legend.SubTitleStyle.PickText
End Sub
Private Sub cmdTitleStyle_Click()
If ckCompact.Value = 1 Then
gTheme.Legend.CompactTitleStyle.PickText
Else
gTheme.Legend.TitleStyle.PickText
End If
End Sub
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -