Eyesonme
路人甲
路人甲
  • 注册日期2006-05-27
  • 发帖数21
  • QQ
  • 铜币234枚
  • 威望0点
  • 贡献值0点
  • 银元0个
阅读:1915回复:1

[求助]显示图层属性

楼主#
更多 发布于:2006-09-21 10:39
<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>
喜欢0 评分0
hsghxm
路人甲
路人甲
  • 注册日期2004-10-27
  • 发帖数517
  • QQ4604052
  • 铜币1枚
  • 威望0点
  • 贡献值0点
  • 银元0个
1楼#
发布于:2006-09-22 09:19
<img src="images/post/smile/dvbbs/em01.gif" />
MSN:hsghxm@163.com QQ:4604052 (很少用,最好别加) Email:hsghxm@163.com 我的BOLG:http://www.gisempire.com/blog/user1/864/index.htm
举报 回复(0) 喜欢(0)     评分
游客

返回顶部