📄 form7.frm
字号:
VERSION 5.00
Object = "{831FDD16-0C5C-11D2-A9FC-0000F8754DA1}#2.0#0"; "MSCOMCTL.OCX"
Begin VB.Form Form7
Caption = "Form7"
ClientHeight = 7410
ClientLeft = 60
ClientTop = 450
ClientWidth = 12285
LinkTopic = "Form7"
ScaleHeight = 7410
ScaleWidth = 12285
StartUpPosition = 3 '窗口缺省
Begin VB.ComboBox Combo2
Height = 300
Left = 4320
TabIndex = 6
Text = "Combo2"
Top = 1800
Visible = 0 'False
Width = 975
End
Begin MSComctlLib.ListView ListView1
Height = 6255
Left = 1920
TabIndex = 4
Top = 720
Width = 10215
_ExtentX = 18018
_ExtentY = 11033
View = 3
LabelWrap = -1 'True
HideSelection = -1 'True
_Version = 393217
ForeColor = -2147483640
BackColor = -2147483643
BorderStyle = 1
Appearance = 1
NumItems = 0
End
Begin VB.ListBox List1
Height = 5280
Left = 120
TabIndex = 1
Top = 1680
Width = 1455
End
Begin VB.ComboBox Combo1
Height = 300
Left = 120
TabIndex = 0
Text = "Combo1"
Top = 720
Width = 1455
End
Begin VB.Label Label3
Caption = "属性表"
Height = 255
Left = 1920
TabIndex = 5
Top = 360
Width = 975
End
Begin VB.Label Label2
Caption = "请选择字段"
Height = 375
Left = 120
TabIndex = 3
Top = 1320
Width = 1215
End
Begin VB.Label Label1
Caption = "请选择图层"
Height = 255
Left = 120
TabIndex = 2
Top = 360
Width = 1095
End
End
Attribute VB_Name = "Form7"
Attribute VB_GlobalNameSpace = False
Attribute VB_Creatable = False
Attribute VB_PredeclaredId = True
Attribute VB_Exposed = False
Private Sub Combo1_Click()
List1.Clear
ListView1.ColumnHeaders.Clear
ListView1.ListItems.Clear
Dim J As Integer
Dim K As Integer
Set Rect = Form1.Map1.Layers(Combo1.Text).Records
For Each Fld In Rect.Fields
Combo2.AddItem Fld.Name
List1.AddItem Fld.Name
Combo2.Text = Combo2.List(0)
Set Col = ListView1.ColumnHeaders.Add()
Col.Text = Fld.Name
Next Fld
Do While Not Rect.EOF
Set Lisit = ListView1.ListItems.Add(, , Rect.Fields(List1.List(0)).ValueAsString)
For K = 1 To List1.ListCount - 1
Lisit.SubItems(K) = Rect.Fields(List1.List(K)).ValueAsString
Next K
Rect.MoveNext
Loop
End Sub
Private Sub Combo2_Click()
Set Col = ListView1.ColumnHeaders.Add()
Col.Text = Combo2.Text
Set Rect = Form1.Map1.Layers(Combo1.Text).Records
Do While Not Rect.EOF
Set Lisit = ListView1.ListItems.Add(, , Rect.Fields(Combo2.List(Combo1.ListIndex)).ValueAsString)
Rect.MoveNext
Loop
End Sub
Private Sub Form_Load()
Combo1.Clear
For Each l In Form1.Map1.Layers
Combo1.AddItem l.Name
Next
Combo1.Text = Combo1.List(0)
End Sub
Private Sub Form_Unload(Cancel As Integer)
Combo1.Clear
Combo2.Clear
ListView1.ColumnHeaders.Clear
ListView1.ListItems.Clear
End Sub
Private Sub List1_Click()
ListView1.ColumnHeaders.Clear
ListView1.ListItems.Clear
Set Col = ListView1.ColumnHeaders.Add()
Col.Width = 3000
Col.Text = List1.Text
Set Rect = Form1.Map1.Layers(Combo1.Text).Records
Do While Not Rect.EOF
Set Lisit = ListView1.ListItems.Add(, , Rect.Fields(List1.List(List1.ListIndex)).ValueAsString)
Rect.MoveNext
Loop
End Sub
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -