📄 frmmain.frm
字号:
End If
i = i + 1
End If
Next
ProBar1.Value = ProBar1.Value + 11
'/*种植业层*/
Set myfeatures_aa = fMainForm.Map1.Layers.Item("a-种植业").AllFeatures
'/*以下判断1g12层中selectfeature的被包含在aa层中的哪个feature中*/
i = 1 '判断是否第一次给list1 add item,如果是第一次要加上“所属地貌类型 ”这四个字,否则不要加这几个字
For Each myfeature_aa In myfeatures_aa
If Map1.FeatureFactory.IntersectionTest(SelectFeature, myfeature_aa, 1) Then
Set ds = fMainForm.Map1.Datasets.Item("a-zz")
If i = 1 Then
frmSelectPoint.List1.AddItem " 所属种植业类型 |" & ds.RowValues(myfeature_aa).Item("说明").Value
Else
frmSelectPoint.List1.AddItem " |" & ds.RowValues(myfeature_aa).Item("说明").Value
End If
i = i + 1
End If
Next
ProBar1.Value = ProBar1.Value + 11
'/*综合农业层*/
Set myfeatures_aa = fMainForm.Map1.Layers.Item("a-综农").AllFeatures
'/*以下判断1g12层中selectfeature的被包含在aa层中的哪个feature中*/
i = 1 '判断是否第一次给list1 add item,如果是第一次要加上“所属地貌类型 ”这四个字,否则不要加这几个字
For Each myfeature_aa In myfeatures_aa
If Map1.FeatureFactory.IntersectionTest(SelectFeature, myfeature_aa, 1) Then
Set ds = fMainForm.Map1.Datasets.Item("a-zl")
If i = 1 Then
frmSelectPoint.List1.AddItem " 所属综合农业类型 |" & ds.RowValues(myfeature_aa).Item("说明").Value
Else
frmSelectPoint.List1.AddItem " |" & ds.RowValues(myfeature_aa).Item("说明").Value
End If
i = i + 1
End If
Next
ProBar1.Value = ProBar1.Value + 11
End If
If myflag = True Then '针对yearsdata表绑定后的情况
Set ds = Map1.Datasets.Item("1g12_year")
frmSelectPoint.List1.AddItem " 年份 |" & ds.RowValues(SelectFeature).Item("年份").Value
frmSelectPoint.List1.AddItem " 播种面积(亩) |" & ds.RowValues(SelectFeature).Item("播种面积").Value
frmSelectPoint.List1.AddItem " 耕地面积(亩) |" & ds.RowValues(SelectFeature).Item("耕地面积").Value
frmSelectPoint.List1.AddItem " 县总人口(人) |" & ds.RowValues(SelectFeature).Item("县总人口").Value
frmSelectPoint.List1.AddItem " 非农业人口(万人) |" & ds.RowValues(SelectFeature).Item("非农业人口").Value
frmSelectPoint.List1.AddItem " 农村人口(人) |" & ds.RowValues(SelectFeature).Item("农村人口").Value
frmSelectPoint.List1.AddItem " 男性人口(人) |" & ds.RowValues(SelectFeature).Item("男性人口").Value
frmSelectPoint.List1.AddItem " 女性人口(人) |" & ds.RowValues(SelectFeature).Item("女性人口").Value
frmSelectPoint.List1.AddItem " 从业人员(人) |" & ds.RowValues(SelectFeature).Item("从业人员").Value
frmSelectPoint.List1.AddItem "农民人均纯收入(元)|" & ds.RowValues(SelectFeature).Item("农民人均纯收入").Value
frmSelectPoint.List1.AddItem " 粮食总产(吨) |" & ds.RowValues(SelectFeature).Item("粮食总产").Value
frmSelectPoint.List1.AddItem "国内生产总值(万元)|" & ds.RowValues(SelectFeature).Item("国内生产总值").Value
frmSelectPoint.List1.AddItem "第一产业产值(万元)|" & ds.RowValues(SelectFeature).Item("第一产业产值").Value
frmSelectPoint.List1.AddItem "第二产业产值(万元)|" & ds.RowValues(SelectFeature).Item("第二产业产值").Value
frmSelectPoint.List1.AddItem "第三产业产值(万元)|" & ds.RowValues(SelectFeature).Item("第三产业产值").Value
frmSelectPoint.List1.AddItem "种植业产值(万元) |" & ds.RowValues(SelectFeature).Item("种植业产值").Value
frmSelectPoint.List1.AddItem " 牧业产值(万元) |" & ds.RowValues(SelectFeature).Item("牧业产值").Value
frmSelectPoint.List1.AddItem " 林业产值(万元) |" & ds.RowValues(SelectFeature).Item("林业产值").Value
frmSelectPoint.List1.AddItem "乡镇企业产值(万元)|" & ds.RowValues(SelectFeature).Item("乡镇企业产值").Value
End If
If Map1.Geoset = App.Path & "\maps\四川省行政区划图.gst" Then
frmSelectPoint.Width = 3495
frmSelectPoint.Left = Me.Width - 3700
frmSelectPoint.Top = 6000
Else
ProBar1.Visible = False
frmSelectPoint.Width = 5000
frmSelectPoint.Left = Me.Width - 5200
frmSelectPoint.Top = 5700
frmSelectPoint.Show , Me
End If
frmSelectPoint.Show , Me
Else '选区内地物>1
Unload frmSelectPoint
Set SelectFeatures = Map1.Layers("1g12").Selection.Clone
If myflag = True Then '针对yearsdata表绑定后的情况
Set ds = Map1.Datasets.Item("1g12_year")
If Map1.Geoset = App.Path & "\maps\四川省行政区划图.gst" Then
DsCols = 23 '经过数据绑定后的字段数也就是grid的列数
Else '针对其它地图,增加9个“所属区域”列
DsCols = 32
End If
DsRows = SelectFeatures.Count 'features的个数就是记录数
frmselectmore.MSFlexGrid1.Rows = DsRows + 1 'grid的行数包括字段名所占的一行
frmselectmore.MSFlexGrid1.Cols = DsCols '字段数也就是grid的列数
frmselectmore.MSFlexGrid1.Row = 0 '这一行就是字段名所占的行
'/*以下是给grid各列赋字段名,在gird的第0行各列写字段名,grid的行号和列号均是从0开始*/
If Map1.Geoset = App.Path & "\maps\四川省行政区划图.gst" Then
For i = 0 To DsCols - 1
frmselectmore.MSFlexGrid1.Col = i
If i <= 3 Then '前四个字段名从dataset("1g12")得到
Set ds = Map1.Datasets.Item("1g12")
If ds.Fields.Item(i + 3).Name = "土地面积" Then
frmselectmore.MSFlexGrid1.Text = ds.Fields.Item(i + 3).Name & "(平方公里)"
Else
frmselectmore.MSFlexGrid1.Text = ds.Fields.Item(i + 3).Name
End If
Else '后面的字段从dataset("1g12_year")得到
Set ds = Map1.Datasets.Item("1g12_year")
'/*以下是给各字段名加上相应的单位*/
If ds.Fields.Item(i - 2).Name = "播种面积" Or ds.Fields.Item(i - 2).Name = "耕地面积" Then
frmselectmore.MSFlexGrid1.Text = ds.Fields.Item(i - 2).Name & "(亩)"
Else
If ds.Fields.Item(i - 2).Name = "农民人均纯收入" Then
frmselectmore.MSFlexGrid1.Text = ds.Fields.Item(i - 2).Name & "(元)"
Else
If ds.Fields.Item(i - 2).Name = "粮食总产" Then
frmselectmore.MSFlexGrid1.Text = ds.Fields.Item(i - 2).Name & "(吨)"
Else
If ds.Fields.Item(i - 2).Name = "非农业人口" Then
frmselectmore.MSFlexGrid1.Text = ds.Fields.Item(i - 2).Name & "(万人)"
Else
If ds.Fields.Item(i - 2).Name = "县总人口" Or ds.Fields.Item(i - 2).Name = "农村人口" Or ds.Fields.Item(i - 2).Name = "男性人口" Or ds.Fields.Item(i - 2).Name = "女性人口" Or ds.Fields.Item(i - 2).Name = "从业人员" Then
frmselectmore.MSFlexGrid1.Text = ds.Fields.Item(i - 2).Name & "(人)"
Else
If ds.Fields.Item(i - 2).Name = "国内生产总值" Or ds.Fields.Item(i - 2).Name = "第一产业产值" Or ds.Fields.Item(i - 2).Name = "第二产业产值" Or ds.Fields.Item(i - 2).Name = "第三产业产值" Or ds.Fields.Item(i - 2).Name = "种植业产值" Or ds.Fields.Item(i - 2).Name = "牧业产值" Or ds.Fields.Item(i - 2).Name = "林业产值" Or ds.Fields.Item(i - 2).Name = "乡镇企业产值" Then
frmselectmore.MSFlexGrid1.Text = ds.Fields.Item(i - 2).Name & "(万元)"
Else
frmselectmore.MSFlexGrid1.Text = ds.Fields.Item(i - 2).Name
End If
End If
End If
End If
End If
End If
End If
Next i
frmselectmore.MSFlexGrid1.ColWidth(0) = 1000 '县名
frmselectmore.MSFlexGrid1.ColWidth(1) = 1000 '行政代码
frmselectmore.MSFlexGrid1.ColWidth(2) = 1000 '邮政编码
frmselectmore.MSFlexGrid1.ColWidth(3) = 2000 '土地面积
frmselectmore.MSFlexGrid1.ColWidth(4) = 500 '年份
frmselectmore.MSFlexGrid1.ColWidth(5) = 1300 '播种面积
frmselectmore.MSFlexGrid1.ColWidth(6) = 1300 '耕地面积
frmselectmore.MSFlexGrid1.ColWidth(7) = 1300 '县总人口
frmselectmore.MSFlexGrid1.ColWidth(8) = 1800 '非农业人口
frmselectmore.MSFlexGrid1.ColWidth(9) = 1300 '农村人口
frmselectmore.MSFlexGrid1.ColWidth(10) = 1300 '男性人口
frmselectmore.MSFlexGrid1.ColWidth(11) = 1300 '女性人口
frmselectmore.MSFlexGrid1.ColWidth(12) = 1300 '从业人员
frmselectmore.MSFlexGrid1.ColWidth(13) = 2000 '农民人均纯收入
frmselectmore.MSFlexGrid1.ColWidth(14) = 1300 '粮食总产
frmselectmore.MSFlexGrid1.ColWidth(15) = 2000 '国内生产总值
frmselectmore.MSFlexGrid1.ColWidth(16) = 2000 '第一产业产值
frmselectmore.MSFlexGrid1.ColWidth(17) = 2000 '第二产业产值
frmselectmore.MSFlexGrid1.ColWidth(18) = 2000 '第三产业产值
frmselectmore.MSFlexGrid1.ColWidth(19) = 1800 '种植业产值
frmselectmore.MSFlexGrid1.ColWidth(20) = 1600 '牧业产值
frmselectmore.MSFlexGrid1.ColWidth(21) = 1600 '林业产值
frmselectmore.MSFlexGrid1.ColWidth(22) = 2000 '乡镇企业产值
Else '针对其它地图
ProBar1.Visible = True
For i = 0 To DsCols - 1
frmselectmore.MSFlexGrid1.Col = i
If i <= 3 Then '前四个字段名从dataset("1g12")得到
Set ds = Map1.Datasets.Item("1g12")
If ds.Fields.Item(i + 3).Name = "土地面积" Then
frmselectmore.MSFlexGrid1.Text = ds.Fields.Item(i + 3).Name & "(平方公里)"
Else
frmselectmore.MSFlexGrid1.Text = ds.Fields.Item(i + 3).Name
End If
Else
If i = 4 Then
frmselectmore.MSFlexGrid1.Text = "所属地貌类型"
Else
If i = 5 Then
frmselectmore.MSFlexGrid1.Text = "所属气候类型"
Else
If i = 6 Then
frmselectmore.MSFlexGrid1.Text = "所属水利类型"
Else
If i = 7 Then
frmselectmore.MSFlexGrid1.Text = "所属水文类型"
Else
If i = 8 Then
frmselectmore.MSFlexGrid1.Text = "所属乡镇企业类型"
Else
If i = 9 Then
frmselectmore.MSFlexGrid1.Text = "所属畜牧业类型"
Else
If i = 10 Then
frmselectmore.MSFlexGrid1.Text = "所属渔业类型"
Else
If i = 11 Then
frmselectmore.MSFlexGrid1.Text = "所属种植业类型"
Else
If i = 12 Then
frmselectmore.MSFlexGrid1.Text = "所属综合农业类型"
Else '后面的字段从dataset("1g12_year")得到
Set ds = Map1.Datasets.Item("1g12_year")
'/*以下是给各字段名加上相应的单位*/
If ds.Fields.Item(i - 11).Name = "播种面积" Or ds.Fields.Item(i - 11).Name = "耕地面积" Then
frmselectmore.MSFlexGrid1.Text = ds.Fields.Item(i - 11).Name & "(亩)"
Else
If ds.Fields.Item(i - 11).Name = "农民人均纯收入" Then
frmselectmore.MSFlexGrid1.Text = ds.Fields.Item(i - 11).Name & "(元)"
Else
If ds.Fields.Item(i - 11).Name = "粮食总产" Then
frmselectmore.MSFlexGrid1.Text = ds.Fields.Item(i - 11).Name & "(吨)"
Else
If ds.Fields.Item(i - 11).Name = "非农业人口" Then
frmselectmore.MSFlexGrid1.Text = ds.Fields.Item(i - 11).Name & "(万人)"
Else
If ds.Fields.Item(i - 11).Name = "县总人口" Or ds.Fields.Item(i - 11).Name = "农村人口" Or ds.Fields.Item(i - 11).Name = "男性人口" Or ds.Fields.Item(i - 11).Name = "女性人口" Or ds.Fields.Item(i - 11).Name = "从业人员" Then
frmselectmore.MSFlexGrid1.Text = ds.Fields.Item(i - 11).Name & "(人)"
Else
If ds.Fields.Item(i - 11).Name = "国内生产总值" Or ds.Fields.Item(i - 11).Name = "第一产业产值" Or ds.Fields.Item(i - 11).Name = "第二产业产值" Or ds.Fields.Item(i - 11).Name = "第三产业产值" Or ds.Fields.Item(i - 11).Name = "种植业产值" Or ds.Fields.Item(i - 11).Name = "牧业产值" Or ds.Fields.Item(i - 11).Name = "林业产值" Or ds.Fields.Item(i - 11).Name = "乡镇企业产值" Then
frmselectmore.MSFlexGrid1.Text = ds.Fields.Item(i - 11).Name & "(万元)"
Else
frmselectmore.MSFlexGrid1.Text = ds.Fields.Item(i - 11).Name
End If
End If
End If
End If
End If
End If
End If
End If
End If
End If
End If
End If
End If
End If
End If
End If
Next i
frmselectmore.MSFlexGrid1.ColWidth(0) = 1000 '县名
frmselectmore.MSFlexGrid1.ColWidth(1) = 1000 '行政代码
frmselectmore.MSFlexGrid1.ColWidth(2) = 1000 '邮政编码
frmselectmore.MSFlexGrid1.ColWidth(3) = 2000 '土地面积
frmselectmore.MSFlexGrid1.ColWidth(4) = 4000 '所属地貌类型
frmselectmore.MSFlexGrid1.ColWidth(5) = 4000 '所属气候类型
frmselectmore.MSFlexGrid1.ColWidth(6) = 4000 '所属水利类型
frmselectmore.MSFlexGrid1.ColWidth(7) = 4000 '所属水文类型
frmselectmore.MSFlexGrid1.ColWidth(8) = 4000 '所属企业类型
frmselectmore.MSFlexGrid1.ColWidth(9) = 4000 '所属畜牧业类型
frmselectmore.MSFlexGrid1.ColWidth(10) = 4000 '所属渔业类型
frmselectmore.MSFlexGrid1.ColWidth(11) = 4000 '所属种植业类型
frmselectmore.MSFlexGrid1.ColWidth(12) = 4000 '所属综合农业类型
frmselectmore.MSFlexGrid1.ColWidth(13) = 500 '年份
frmselectmore.MSFlexGrid1.ColWidth(14) = 1300 '播种面积
frmselectmore.MSFlexGrid1.ColWidth(15) = 1300 '耕地面积
frmselectmore.MSFlexGrid1.ColWidth(16) = 1300 '县总人口
frmselectmore.MSFlexGrid1.ColWidth(17) = 1800 '非农业人口
frmselectmore.MSFlexGrid1.ColWidth(18) = 1300 '农村人口
frmselectmore.MSFlexGrid1.ColWidth(19) = 1300 '男性人口
frmselectmore.MSFlexGrid1.ColWidth(20) = 1300 '女性人口
frmselectmore.MSFlexGrid1.ColWidth(21) = 1300 '从业人员
frmselectmore.MSFlexGrid1.ColWidth(22) = 2000 '农民人均纯收入
frmselectmore.MSFlexGrid1.ColWidth(23) = 1300 '粮食总产
frmselectmore.MSFlexGrid1.ColWidth(24) = 2000 '国内生产总值
frmselectmore.MSFlexGrid1.ColWidth(25) = 2000 '第一产业产值
frmselectmore.MSFlexGrid1.ColWidth(26) = 2000 '第二产业产值
frmselectmore.MSFlexGrid1.ColWidth(27) = 2000 '第三产业产值
frmselectmore.MSFlexGrid1.ColWidth(28) = 180
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -