2,727
社区成员
发帖
与我相关
我的任务
分享
* 添加几个测试节点
With This
.Nodes.Add( ,, 'R1', '根节点')
.Nodes.Add( 'R1', 4, 'S1', '子节点1')
.Nodes.Add( 'R1', 4, 'S2', '子节点2')
.Nodes.Add( 'R1', 4, 'S3', '子节点3')
.Nodes.Add( 'S1', 4, 'S11', '孙节点11')
.Nodes.Add( 'S1', 4, 'S12', '孙节点12')
.Nodes.Add( 'S2', 4, 'S21', '孙节点21')
.Nodes.Add( 'S2', 4, 'S22', '孙节点22')
.SelectedItem = .Nodes.Item(5)
Endwith
* 下面设置 explore 样式
#Define GWL_STYLE -16
#Define TV_FIRST 0x1100
#Define TVM_SETEXTENDEDSTYLE (TV_FIRST + 44)
#Define TVM_GETEXTENDEDSTYLE (TV_FIRST + 45)
#Define TVS_HASLINES 0x0002
#Define TVS_TRACKSELECT 0x0200
#Define TVS_EX_FADEINOUTEXPANDOS 0x0040
Declare Long GetWindowLong In WIN32API Long, Long
Declare Long SetWindowLong In WIN32API Long, Long, Long
Declare Long SetWindowTheme In uxtheme Long, String, String
Declare Long SendMessage In WIN32API As sendmsg_nn Long, Long, Long, Long
With This
m.lnStyle = GetWindowLong(.HWnd, GWL_STYLE)
m.lnStyle = Bitor(m.lnStyle, TVS_TRACKSELECT) && 启用热跟踪
m.lnStyle = Bitand(m.lnStyle, Bitnot(TVS_HASLINES)) && 不显示连接线
SetWindowLong(.HWnd, GWL_STYLE, m.lnStyle)
SetWindowTheme(.HWnd, Strconv('explorer'+Chr(0),5), Null) && 设置 explore 样式
m.lnExStyle = sendmsg_nn(.HWnd, TVM_GETEXTENDEDSTYLE, 0, 0)
m.lnExStyle = Bitor(m.lnExStyle, TVS_EX_FADEINOUTEXPANDOS) && 启用淡入淡出效果
sendmsg_nn(.HWnd, TVM_SETEXTENDEDSTYLE, 0, m.lnExStyle)
Endwith