如题,如果有现成做好的,请给我一份,不禁感激

解决方案 »

  1.   

    tmpNd.Text = "<font style='TEXT-DECORATION: underline'>"+显示字符串+"</font>";
    解释:tmpNd为结点,它的值你要直接加style的
      

  2.   

    就是动态的啊,你把显是的值改掉就可以了
    比如你要显示"中国"就改为显示"<font style='...'>中国</font>"就行了
      

  3.   

    Dim tnd As New TreeNode
    Dim tndChild As New TreeNodetnd.Text = "root"
    tnd.DefaultStyle.CssText = "color:#ffffff;background-color:#cc0000;"
    tnd.HoverStyle.CssText = "color:#ffffff;background-color:#cc0000;"
    tnd.SelectedStyle.CssText = "color:#ffffff;background-color:#cc0000;"tndChild.Text = "Child"
    tndChild.DefaultStyle.CssText = "color:#ffffff;background-color:#0000ff;"
    tndChild.HoverStyle.CssText = "color:#ffffff;background-color:#0000ff;"
    tndChild.SelectedStyle.CssText = "color:#ffffff;background-color:#0000ff;"tnd.Nodes.Add(tndChild)
    TreeView1.Nodes.Add(tnd)TreeView1.ExpandLevel = 5PlaceHolder1.Controls.Add(New LiteralControl("<div style='background-color:#ffcc99'>"))
    PlaceHolder1.Controls.Add(TreeView1)
    PlaceHolder1.Controls.Add(New LiteralControl("</div>"))