会员
周边
众包
新闻
博问
闪存
所有博客
当前博客
我的博客
我的园子
账号设置
简洁模式
...
退出登录
注册
登录
newos
博客开始持续更新中
新随笔
联系
管理
TREEVIEW绑定到textblock
Code
1
<
Window x:Class
=
"
WpfApplication2.Window1
"
2
xmlns
=
"
http://schemas.microsoft.com/winfx/2006/xaml/presentation
"
3
xmlns:x
=
"
http://schemas.microsoft.com/winfx/2006/xaml
"
4
Title
=
"
Window1
"
Height
=
"
344
"
Width
=
"
444
"
>
5
<
Grid
>
6
7
<
TreeView HorizontalAlignment
=
"
Left
"
Margin
=
"
0,12,0,43
"
Name
=
"
treeView1
"
Width
=
"
148
"
SelectedItemChanged
=
"
treeView1_SelectedItemChanged
"
>
8
9
<
TreeViewItem Header
=
"
FUJIAN
"
>
fujian
</
TreeViewItem
>
10
<
TreeViewItem Header
=
"
BEIJING
"
>
beijing
</
TreeViewItem
>
11
</
TreeView
>
12
<
TextBlock Height
=
"
26
"
Margin
=
"
201,36,97,0
"
Name
=
"
textBlock1
"
VerticalAlignment
=
"
Top
"
Text
=
"
{Binding ElementName=treeView1,Path=SelectedItem.Header}
"
/>
13
</
Grid
>
14
</
Window
>
15
这个是今晚做的一个简单的TREEVIEW和textblock中显示的一个例子,很简单哦。
posted @
2009-03-29 23:03
newos
阅读(
178
) 评论(
0
)
编辑
收藏
举报
会员力量,点亮园子希望
刷新页面
返回顶部
公告