📄 frmstyle.frm
字号:
VERSION 5.00
Begin VB.Form FrmStyle
BorderStyle = 3 'Fixed Dialog
Caption = "Insertion Layer Style"
ClientHeight = 2955
ClientLeft = 2760
ClientTop = 3750
ClientWidth = 6780
LinkTopic = "Form1"
MaxButton = 0 'False
MinButton = 0 'False
ScaleHeight = 2955
ScaleWidth = 6780
ShowInTaskbar = 0 'False
Begin VB.CommandButton CmdCancel
Cancel = -1 'True
Caption = "Cancel"
Height = 375
Left = 3360
TabIndex = 7
Top = 2520
Width = 1455
End
Begin VB.CommandButton PointCmd
Caption = "Modify &Point Style"
Height = 375
Left = 0
TabIndex = 6
Top = 1920
Width = 2175
End
Begin VB.PictureBox SymbolPict
Height = 1815
Left = 0
ScaleHeight = 117
ScaleMode = 3 'Pixel
ScaleWidth = 141
TabIndex = 5
Top = 0
Width = 2175
End
Begin VB.CommandButton RegionCmd
Caption = "Modify &Region Style"
Height = 375
Left = 4560
TabIndex = 4
Top = 1920
Width = 2175
End
Begin VB.PictureBox RegionPict
Height = 1815
Left = 4560
ScaleHeight = 117
ScaleMode = 3 'Pixel
ScaleWidth = 141
TabIndex = 3
Top = 0
Width = 2175
End
Begin VB.PictureBox LinePict
Height = 1815
Left = 2280
ScaleHeight = 117
ScaleMode = 3 'Pixel
ScaleWidth = 141
TabIndex = 2
Top = 0
Width = 2175
End
Begin VB.CommandButton LineCmd
Caption = "Modify &Line Style"
Height = 375
Left = 2280
TabIndex = 1
Top = 1920
Width = 2175
End
Begin VB.CommandButton OKButton
Caption = "OK"
Height = 375
Left = 1920
TabIndex = 0
Top = 2520
Width = 1335
End
Begin VB.Line Line2
BorderColor = &H80000005&
X1 = 0
X2 = 6840
Y1 = 2420
Y2 = 2420
End
Begin VB.Line Line1
BorderColor = &H80000003&
X1 = 0
X2 = 6840
Y1 = 2400
Y2 = 2400
End
End
Attribute VB_Name = "FrmStyle"
Attribute VB_GlobalNameSpace = False
Attribute VB_Creatable = False
Attribute VB_PredeclaredId = True
Attribute VB_Exposed = False
' 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.
Option Explicit
' Local copy of the layer style. We need to make a copy so that the
' user can click on cancel without altering the layer's style.
Dim myStyle As Style
Private Sub CmdCancel_Click()
Unload Me
End Sub
Private Sub Form_Load()
If IsEmpty(FrmMain.Map1.Layers.InsertionLayer) Then
Unload Me
End If
' Keep the map from redrawing as we modify the style.
FrmMain.Map1.AutoRedraw = False
' We want to let the user click on Cancel without changing the
' style of the insertion layer. So, we make changes to a local
' copy of the style (myStyle), and then only set the style when
' OK is clicked
Set myStyle = FrmMain.Map1.Layers.InsertionLayer.Style.Clone
End Sub
Private Sub Form_Paint()
Dim rect As New Rectangle
' First, clear the existing picture.
SymbolPict.Cls
LinePict.Cls
RegionPict.Cls
' Draw samples of the style types (line, point, and region) in
' the three picture boxes.
rect.Set 0, 0, SymbolPict.ScaleWidth, SymbolPict.ScaleHeight
myStyle.DrawSymbolSample SymbolPict.hDC, rect
rect.Set 0, 0, LinePict.ScaleWidth, LinePict.ScaleHeight
myStyle.DrawLineSample LinePict.hDC, rect
rect.Set 0, 0, RegionPict.ScaleWidth, RegionPict.ScaleHeight
myStyle.DrawRegionSample RegionPict.hDC, rect
End Sub
Private Sub Form_Unload(Cancel As Integer)
FrmMain.Map1.AutoRedraw = True
End Sub
Private Sub LineCmd_Click()
' Pop up the builtin Line picker dialog. These Style attributes are used
' for the Line and Polyline features of the layer.
myStyle.PickLine
End Sub
Private Sub OKButton_Click()
FrmMain.Map1.Layers.InsertionLayer.OverrideStyle = True
Set FrmMain.Map1.Layers.InsertionLayer.Style = myStyle
Unload Me
End Sub
Private Sub PointCmd_Click()
' Pop up the builtin Symbol picker dialog. These Style attributes are used
' for the Point features of the layer.
myStyle.PickSymbol
End Sub
Private Sub RegionCmd_Click()
' Pop up the builtin Region picker dialog. These Style attributes are used
' for the Polygon features of the layer.
myStyle.PickRegion
End Sub
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -