会员
周边
众包
新闻
博问
闪存
所有博客
当前博客
我的博客
我的园子
账号设置
简洁模式
...
退出登录
注册
登录
高原之上
博客园
首页
新随笔
新文章
联系
管理
订阅
TreeList 选中节点时图标状态和背景色
/**/
///
给TreeList加SelectImage
this
.treelArea.SelectImageList
=
imglCustom;
/**/
///
///
去掉选中节点时的虚框
this
.treelArea.OptionsView.ShowFocusedFrame;
/**/
///
///
设置选中时节点的背景色
this
.treelArea.Appearance.FocusedCell.BackColor
=
System.Drawing.Color.LightSteelBlue;
this
.treelArea.Appearance.FocusedCell.BackColor2
=
System.Drawing.Color.SteelBlue;
this
.treelArea.Appearance.FocusedCell.Options.UseBackColor
=
true
;
/**/
///
///
选中时会把节点中没显示完全的信息全部显示
this
.treelArea.Appearance.FocusedCell.Options.UseTextOptions
=
true
;
this
.treelArea.Appearance.FocusedCell.TextOptions.WordWrap
=
DevExpress.Utils.WordWrap.Wrap;
/**/
///
///
///
<summary>
///
Handles the GetSelectImage event of the treelArea control.
///
设置SelectImage的状态,如果是选中的则换成另选中时应该显示的图标
///
</summary>
///
<param name="sender">
The source of the event.
</param>
///
<param name="e">
The
<see cref="DevExpress.XtraTreeList.GetSelectImageEventArgs"/>
instance containing the event data.
</param>
private
void
treelArea_GetSelectImage(
object
sender, DevExpress.XtraTreeList.GetSelectImageEventArgs e)
{
e.NodeImageIndex
=
e.Node.Expanded
?
0
: e.Node.Nodes.Count
>
0
?
1
:
2
;
if
(e.FocusedNode)
{
e.NodeImageIndex
+=
3
;
}
}
posted on
2007-08-28 15:49
高原之上
阅读(
1271
) 评论(
1
)
编辑
收藏
举报
会员力量,点亮园子希望
刷新页面
返回顶部
公告