本人菜鸟,有以下问题:
1.treeview控件,如何为节点事件分别链接图片?
2.sstab如何为添加各标签上添加类似excel的计算表格?并且能做一定的计算何调用?

解决方案 »

  1.   

    treeview我天天用啊,什么叫“节点事件”,没看懂的说你是希望给每个节点不同的图标么?
      

  2.   

    就是点击各节点之后,在一旁的image或者是pictrue里出现对应的图片,
      

  3.   

    在nodeclick事件过程里写显示图片的代码就可以了。
      

  4.   

    老哥,帮个忙啊!我就是想给每个节点一个链接一个相应的的说明性图片。能不能举个代码例子给我?
    比如:节点是省份,当我点击“江西省”则在一旁的image框中显示江西省的地图?
      

  5.   

    Private Sub TreeView1_NodeClick(ByVal Node As MSComctlLib.Node)
       If TreeView1.SelectedItem.Children = 0 Then '检查是否有子节点,0为无
         For I = 1 To TreeView1.Nodes.Count
         If TreeView1.Nodes(I).Selected Then
           MsgBox "您选择的是:“" & TreeView1.Nodes(I).FullPath & "”子节点!"
         End If
         Next I
       End If
    End Sub
      

  6.   

    Private Sub TreeView1_NodeClick(ByVal Node As MSComctlLib.Node) 
      If TreeView1.SelectedItem.text = "江西省" Then 
         image.picture="c:\桌面\江西省地图.jpg"
      End If 
    End Sub
      

  7.   

    Private Sub TreeView1_NodeClick(ByVal Node As MSComctlLib.Node) 
      If node.text = "江西省" Then 
        image.picture="c:\桌面\江西省地图.jpg" 
      End If 
    End Sub
      

  8.   

    Private Sub TreeView1_NodeClick(ByVal Node As MSComctlLib.Node) 
       
      image.picture="c:\桌面\" & node.text & "地图.jpg" 
       
    End Sub
      

  9.   

    说个简单的。
    1、将你要显示的图片,按treeview1对应关系依次放入资源文件中,编号连贯,比如201、202、203、204……。
    2、追加Treeview1项上使用key,有序编号与图片资源编号对应(此步可省略,nodeclick事件中用index对应关系也可)。
    3、用index对应的Nodeclick事件代码事例:
    Private Sub TreeView1_NodeClick(ByVal Node As MSComctlLib.Node) 
       image1.Picture = LoadResPicture(200+node.index+1, 0)
    End Sub说明:1、第一个节点index为0
    2、Loadrespicture()第一位参数为整数或字符串,表示资源文件中数据的ID;第二个参数0表示位图
    另外,直接使用200+node.index+1,我可没有试过。如果不行再加个int(),强制转为整型。