TreeNode节点显示的字符串为“节点(1)”如何将"(1)"加粗显示啊?

解决方案 »

  1.   

    WebForm 还是winformWebForm的话,试试设置TreeNode.Text = "节点<b>(1)</b>";winform:不熟悉
      

  2.   

    treeNode1.NodeFont = new System.Drawing.Font("Microsoft Sans Serif", 8.25F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
      

  3.   

    给你个例子,假如想加粗主Node下所包含的第一个Node (this.treeView1.Nodes[0].Nodes[0]):this.treeView1.Nodes[0].Nodes[0].NodeFont = new Font(this.treeView1.Font, FontStyle.Bold);用Font的这个Constructor好一点儿.
      

  4.   

    回楼上的朋友,Nodes[0].NodeFont 通常是Null, 不能用在那个新Font的Constructor里.