📄 frmannotationsdialog.frm
字号:
VERSION 5.00
Begin VB.Form frmAnnotationsDialog
BorderStyle = 3 'Fixed Dialog
Caption = "Annotations Style Dialog"
ClientHeight = 2655
ClientLeft = 2760
ClientTop = 3750
ClientWidth = 5355
Icon = "frmAnnotationsDialog.frx":0000
LinkTopic = "Form1"
MaxButton = 0 'False
MinButton = 0 'False
ScaleHeight = 2655
ScaleWidth = 5355
ShowInTaskbar = 0 'False
Begin VB.CommandButton CancelButton
Cancel = -1 'True
Caption = "Cancel"
Height = 375
Left = 4080
TabIndex = 1
Top = 600
Width = 1215
End
Begin VB.CommandButton OKButton
Caption = "OK"
Default = -1 'True
Height = 375
Left = 4080
TabIndex = 0
Top = 120
Width = 1215
End
Begin VB.CommandButton Text
Caption = "Change Text Style..."
Height = 375
Left = 2280
TabIndex = 5
Top = 1080
Width = 1695
End
Begin VB.CommandButton Symbol
Caption = "Change Symbol..."
Height = 375
Left = 2280
TabIndex = 4
Top = 120
Width = 1695
End
Begin VB.PictureBox TextPicture
Height = 855
Left = 120
ScaleHeight = 795
ScaleWidth = 1995
TabIndex = 3
Top = 1080
Width = 2055
End
Begin VB.PictureBox SymbolPicture
Height = 855
Left = 120
ScaleHeight = 53
ScaleMode = 3 'Pixel
ScaleWidth = 133
TabIndex = 2
Top = 120
Width = 2055
End
Begin VB.Label Label1
Caption = "Note: any changes to the style will affect new annotations only. Existing annotations will be unchanged."
Height = 495
Left = 120
TabIndex = 6
Top = 2160
Width = 4815
End
End
Attribute VB_Name = "frmAnnotationsDialog"
Attribute VB_GlobalNameSpace = False
Attribute VB_Creatable = False
Attribute VB_PredeclaredId = True
Attribute VB_Exposed = False
Option Explicit
' This dialog shows samples of the default text and
' default symbol styles in two picture boxes, and allows
' the user to modify these styles
' We use a global variable named "TestStyle" which contains the current
' style that the user has chosen. When the user presses "OK", the
' Map.DefaultStyle is set to this "TestStyle" variable.
Dim TestStyle As MapXLib.Style
Private Sub CancelButton_Click()
Unload Me
End Sub
Private Sub Form_Load()
' Set the initial values of the "TestStyle" variable to the current defaults
Set TestStyle = fMainForm.Map1.DefaultStyle.Clone
End Sub
Private Sub OKButton_Click()
' Set the default style (which is used for text and symbol annotations) to
' the style that the user picked
Set fMainForm.Map1.DefaultStyle = TestStyle
Unload Me
End Sub
Private Sub Symbol_Click()
Dim Rect As New MapXLib.Rectangle
' Show the dialog that allows the user to change the default symbol style
TestStyle.PickSymbol
' If the user changed the symbol settings, we need to redraw the sample of this
' style
SymbolPicture_Paint
End Sub
Private Sub SymbolPicture_Paint()
' Rect should be the portion of the picture box
' that gets drawn in: we the entire picture box.
Dim Rect As New MapXLib.Rectangle
' The Style.DrawSymbolSample call expects the rectangle to be in pixel units
SymbolPicture.ScaleMode = vbPixels
' Clear the Picture Box
SymbolPicture.Cls
' Set Rect to be the whole picture box
Rect.Set 0, 0, SymbolPicture.ScaleWidth, SymbolPicture.ScaleHeight
' Draw the symbol sample
TestStyle.DrawSymbolSample SymbolPicture.hDC, Rect
End Sub
Private Sub Text_Click()
Dim Rect As New MapXLib.Rectangle
' Show the dialog that allows the user to change the default text style
TestStyle.PickText
' If the user changed the text style settings, we need to redraw
' the sample of this style
TextPicture_Paint
End Sub
Private Sub TextPicture_Paint()
' Rect should be the portion of the picture box
' that gets drawn in: we the entire picture box.
Dim Rect As New MapXLib.Rectangle
' The Style.DrawSymbolSample call expects the rectangle to be in pixel units.
TextPicture.ScaleMode = vbPixels
' Clear the Picture Box
TextPicture.Cls
' Set Rect to be the whole picture box
Rect.Set 0, 0, TextPicture.ScaleWidth, TextPicture.ScaleHeight
' Draw the text sample
TestStyle.DrawTextSample TextPicture.hDC, Rect, "The Quick Brown Fox"
End Sub
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -