求vb+mapx二次开发高手 我已经实现了地图的加载,和一般的功能,现在需要,点击一个区改变区的颜色?
我现在双击一个区,连接到该区的属性数据用frmprop的grid来显示,代码如下:Private Sub Map1_DblClick()
On Error Resume Next
If Map1.CurrentTool = miSelectTool Then
Dim i As Integer
Dim lyr As MapXLib.Layer
Set frmprop.map = Map1
For i = 1 To Map1.Layers.Count
Set lyr = Map1.Layers(i)
If lyr.Selection.Count = 1 Then
frmprop.Grid1.Clear
Dim j As Integer
Dim mydata As MapXLib.Dataset
Dim ftr As MapXLib.Feature
Dim mylist As MSComctlLib.ListItem
Set mydata = Map1.DataSets.Add(miDataSetLayer, lyr)
Set ftr = lyr.Selection.Item(1)
If ftr.Type = miFeatureTypeText Then Exit Sub
frmprop.Grid1.Rows = mydata.Fields.Count + 2
frmprop.Grid1.TextMatrix(0, 0) = "字段名"
frmprop.Grid1.TextMatrix(0, 1) = "字段值"
frmprop.Grid1.TextMatrix(1, 0) = "所在图层"
frmprop.Grid1.TextMatrix(1, 1) = mydata.Layer.Name
frmprop.Grid1.Tag = ftr.FeatureID
For j = 1 To mydata.Fields.Count
frmprop.Grid1.TextMatrix(j + 1, 0) = mydata.Fields(j).Name
Next j
For j = 1 To mydata.Fields.Count
If VarType(mydata.RowValues(ftr.FeatureID).Item(j).value) <> vbNull Then
frmprop.Grid1.TextMatrix(j + 1, 1) = mydata.RowValues(ftr.FeatureID).Item(j).value
End If
Next j
frmprop.Show 0, Me我现在在 frmprop窗口中新建一个command1,和text1,text2。点击command根据text值,改变选中区的颜色,求大神,如当text1,text2都大于200,为绿色,谢谢!! VB Mapx 地图 --------------------编程问答-------------------- 你这个要看Mapx提供的函数阿,写个邮件给他们。不是vb的事情
补充:VB , 控件