各们请帮忙,怎样让WinForm TreeView 有不同节点图片的节点选中时图标都不变?
如题 --------------------编程问答-------------------- 设置 Nodes(索引).SelectedImageIndex 属性(与ImageList绑定) --------------------编程问答-------------------- Node.SelectedImageIndex = Node.SelectedImageIndex; --------------------编程问答-------------------- to: lijie7552()Node.SelectedImageIndex = Node.SelectedImageIndex; ???
你是想说
Nodes(索引).SelectedImageIndex = Nodes(索引).ImageIndex 吧?呵呵 --------------------编程问答-------------------- Node.SelectedImageIndex这个属性设置选择时用哪个图片
如果你默认在ImageList设置的为0,
那把Node.SelectedImageIndex也设置为0,就不会变了 --------------------编程问答-------------------- node.SelectedImageIndex = node.ImageIndex; --------------------编程问答-------------------- private void treeView1_AfterSelect(object sender, TreeViewEventArgs e)
{
treeView1 .SelectedImageIndex = treeView1 .SelectedNode .ImageIndex ;
} --------------------编程问答-------------------- 除 --------------------编程问答-------------------- 分别设置node.SelectedImageIndex和node.ImageIndex;
如:node.SelectedImageIndex = 1;
node.ImageIndex = 1;
补充:.NET技术 , .NET Framework