| 网站首页 | 业界新闻 | 小组 | 威客 | 人才 | 下载频道 | 博客 | 代码贴 | 在线编程 | 编程论坛
欢迎加入我们,一同切磋技术
用户名:   
 
密 码:  
共有 3418 人关注过本帖
标题:禁止鼠标指向treeview结点时显示结点文本
只看楼主 加入收藏
nhhykly9d
Rank: 1
等 级:新手上路
帖 子:30
专家分:5
注 册:2008-1-4
收藏
得分:0 
本问题可以如上法解决,虽然并没有达到禁止tooltip显示,但避免了显示treeview结点文本引起的烦恼.

1,属性中设置:ShowNodeToolTips=True
2,必须把每个已存在的结点和动态生成的结点赋予:currentnode.ToolTipText=""

这样只显示一个很小的tooltip框,不显示结点文本。




[ 本帖最后由 nhhykly9d 于 2010-10-20 23:23 编辑 ]
2010-10-20 22:09
nhhykly9d
Rank: 1
等 级:新手上路
帖 子:30
专家分:5
注 册:2008-1-4
收藏
得分:0 
下面这个达到我理想的解决方案
在VB2005下运行
1,属性中ShowNodeTooltips=false
2,
   Private Declare Function SetWindowLong Lib "user32" _
     Alias "SetWindowLongA" (ByVal hwnd As Integer, ByVal nIndex As Integer, _
     ByVal dwNewLong As Integer) As Integer
    Private Declare Function GetWindowLong Lib "user32" _
     Alias "GetWindowLongA" (ByVal hwnd As Integer, ByVal nIndex As Integer) _
     As Integer
    Private Const TVS_NOTOOLTIPS = &H80
    Private Const GWL_STYLE = (-16)
Private Sub Form1_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
        Dim dwStyle As integer
        dwStyle = GetWindowLong(TreeView1.Handle.ToInt32, GWL_STYLE)
        If (dwStyle And TVS_NOTOOLTIPS) = False Then
            Call SetWindowLong(TreeView1.Handle.ToInt32, GWL_STYLE, _
            dwStyle Or TVS_NOTOOLTIPS)
        End If
   End Sub

这样完全禁止了鼠标经过treeview结点时tooltip的显示。可以结帖了!


[ 本帖最后由 nhhykly9d 于 2010-10-20 23:34 编辑 ]
2010-10-20 23:22
快速回复:禁止鼠标指向treeview结点时显示结点文本
数据加载中...
 
   



关于我们 | 广告合作 | 编程中国 | 清除Cookies | TOP | 手机版

编程中国 版权所有,并保留所有权利。
Powered by Discuz, Processed in 0.014680 second(s), 7 queries.
Copyright©2004-2024, BCCN.NET, All Rights Reserved