阅读:1915回复:1
[求助]显示图层属性
<P>请教各位:</P>
<P>想要右键点击TreeView节点时弹出图层属性菜单,用VB,不是VBA,代码如下:</P> <P>Private Sub TreeView1_NodeClick(ByVal Node As MSComctlLib.Node)</P> <P> Dim pLayer As IFeatureLayer<BR> Dim pTableWin As ITableWindow</P> <P> Dim pStr As String<BR> pStr = Node.Text<BR> Dim i As Integer<BR> For i = 0 To MapControl1.LayerCount - 1<BR> If MapControl1.Layer(i).Name = pStr Then<BR> If TypeOf MapControl1.Layer(i) Is IFeatureLayer Then<BR> Set pLayer = MapControl1.Layer(i)<BR> Exit For<BR> Else<BR> MsgBox "This is not a FeatureLayer."<BR> End If<BR> End If<BR> Next i</P> <P>Set pTableWin = New TableWindow<BR>Set pTableWin.FeatureLayer = pLayer</P> <P><FONT color=#ff0000><STRONG>Set pTableWin.Application = Application</STRONG></FONT><BR>pTableWin.Show True</P> <P>End Sub</P> <P>请问红色一句代码该怎么改,使其适用于VB?</P> <P>谢谢!</P> |
|
1楼#
发布于:2006-09-22 09:19
<img src="images/post/smile/dvbbs/em01.gif" />
|
|
|