关于TREEVIEW的光标显示的形状问题!

bluebirdboy 2003-10-15 10:38:01
如何在treeview中让当鼠标停留在treenode上的时候,treenode接点的光标变为hand形状的光标,注意是在停留在节点上的时候和点击的时候变为hand光标!!
谢谢帮忙!
...全文
63 3 打赏 收藏 转发到动态 举报
写回复
用AI写文章
3 条回复
切换为时间正序
请发表友善的回复…
发表回复
bluebirdboy 2003-10-15
  • 打赏
  • 举报
回复
谢谢,可以了,可是我还希望在所选中的treenode的文字下面显示下划线,不知道怎么样才可以显示UnderLine呢??
colinfly 2003-10-15
  • 打赏
  • 举报
回复
sorry , please use this

private void treeView1_MouseMove(object sender, System.Windows.Forms.MouseEventArgs e)
{
if(this.treeView1.GetNodeAt(e.X,e.Y)!= null)
{
this.treeView1.Cursor = System.Windows.Forms.Cursors.Hand;
}
else
{
this.treeView1.Cursor = System.Windows.Forms.Cursors.Default;
}
}
colinfly 2003-10-15
  • 打赏
  • 举报
回复
响应MouseMove事件
private void treeView1_MouseMove(object sender, System.Windows.Forms.MouseEventArgs e)
{
if(this.treeView1.GetNodeAt(e.X,e.Y)!= null)
{
System.Windows.Forms.Cursor.Current = System.Windows.Forms.Cursors.Hand;
}
else
{
System.Windows.Forms.Cursor.Current = System.Windows.Forms.Cursors.Default;
}
}

110,534

社区成员

发帖
与我相关
我的任务
社区描述
.NET技术 C#
社区管理员
  • C#
  • Web++
  • by_封爱
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告

让您成为最强悍的C#开发者

试试用AI创作助手写篇文章吧