name = Left(CommonDialog1.FileTitle, Len(CommonDialog1.FileTitle))
Set layer.GeoDataset = dc.FindGeoDataset(name)
Map1.Layers.Add layer
Else
Dim fn As String
Dim i As Integer
CommonDialog1.FileName = CommonDialog1.FileName & Chr(0)
names = Split(CommonDialog1.FileName, Chr(0))
For i = 0 To UBound(names) - 1
fn = names(i)
Set layer = New MapLayer
name = Left(fn, Len(fn) - 4)
Set layer.GeoDataset = dc.FindGeoDataset(name)
Map1.Layers.Add layer
Next i
End If
Set dc = Nothing
Set layer = Nothing
End If
l1: Exit Sub
End Sub
窗体 2
Public Function additemfromrecord(strlayer As String, mors As MapObjects2.Recordset)
Dim objnode As Node
Dim strkey As String
Dim strtxt As String
Set objnode = TreeView1.Nodes.Add(, , strlayer, strlayer)
mors.MoveFirst
Do While Not mors.EOF
strkey = strlayer + "/featureid=" + mors.Fields("featureid").ValueAsString
strtxt = mors.Fields("featureid").ValueAsString
Set objnode = TreeView1.Nodes.Add(strlayer, tvwChild, strkey, strtxt)
mors.MoveNext
Loop
Set objnode = Nothing
End Function
Public Function clearrecord()
TreeView1.Nodes.Clear
ListView1.ListItems.Clear
End Function