TreeViewItem item = new TreeViewItem();
item.Header = "推荐";
item.Style = (System.Windows.Style)FindResource("treeControl");
Parent.Items.Add(item); 新加的这个节点必须是带图片的。 不知道图片怎么动态加进去。
item.Header = "推荐";
item.Style = (System.Windows.Style)FindResource("treeControl");
Parent.Items.Add(item); 新加的这个节点必须是带图片的。 不知道图片怎么动态加进去。
解决方案 »
- 单元测试,却看不懂下面一段没有注释的代码,求好心人相助
- [欢迎拍砖]系统分层的三个进阶
- C#中,如何用OpenGL把图像绘制在Form上??
- 关于Form.ShowDialog() 返回值的问题?
- 在线求问3:怎么校验文本框里面输入的是数字或者-或者(),最好用同则表达式。并且要求第一位和最后一位必须是数字
- 求救:使用DirectoryEntry的Add函数向域中添加用户出错!
- c#超级菜鸟,问几个设置问题。
- 怎样让开发的服务程序监控出错的程序,自动重起.高手来....
- 有趣的域名查询问题,请问用C#怎么样才能查到域名注册的详细信息,包括注册人的【联系信息】?
- 关于NHIBERNATE
- 【救命啊~】为什么存储过程读不出来数据?
- 有没有什么办法能判断一个文件夹的子文件夹是否存在?
BitmapImage bitmap = new BitmapImage();
bitmap.BeginInit();
bitmap.UriSource = new Uri(@"");
bitmap.EndInit();http://topic.csdn.net/u/20100611/09/167386DA-ECFC-48CF-A2E6-E0F643CBB322.html
TextBlock tb = new TextBlock();
tb.Text = "推荐";
tb.VerticalAlignment = VerticalAlignment.Center;
System.Windows.Controls.Image img = new System.Windows.Controls.Image();
img.Stretch = Stretch.None;
img.Source = new BitmapImage(new Uri("treeviewChild.png", UriKind.Relative));
dp.Children.Add(img);
dp.Children.Add(tb); TreeViewItem item = new TreeViewItem();
item.Header = dp;
item.Style = (System.Windows.Style)FindResource("treeControl");
Parent.Items.Add(item);