读书人

TreeView的ICO显示Text值正确但是

发布时间: 2012-01-10 21:26:51 作者: rapoo

TreeView的ICO显示,Text值正确,但是没显示出来
private void SecurityManage_Load(object sender, EventArgs e)
{
ImageList il = new ImageList();
il.Images.Add( "1 ", Properties.Resource.ICODepart);
treeView1.ImageList = il;
treeView1.ImageKey = "1 ";

Organization ot=new Organization();
ot.GetOrganizationTree(treeView1.Nodes, "top ");
treeView1.Nodes[0].Expand();
}
不加前四句正常,加了就有问题了。

[解决办法]
在 "设计 "中改一下属性
[解决办法]
System.ComponentModel.ComponentResourceManager resources = new System.ComponentModel.ComponentResourceManager(typeof(DGM));
ImageList imgList2 = new ImageList();
imgList2.ImageStream = ((System.Windows.Forms.ImageListStreamer)(resources.GetObject( "imgList.ImageStream ")));
imgList2.TransparentColor = System.Drawing.Color.Transparent;

imgList2.Images.SetKeyName(0, "BOOK01A.ICO ");

tvShow.ImageList = imgList2;
tvShow.ImageKey = "0 ";


因为 你的 前 4 句 有问题 ////////////////////

读书人网 >C#

热点推荐