private void treeView1_NodeMouseDoubleClick(object sender, TreeNodeMouseClickEventArgs e) {
Rectangle baseRectangle = this.treeView1.SelectedNode.Bounds;
Point mouseClickPoint = e.Location; if (this.treeView1.SelectedNode == e.Node) {
if (WasInBounds(baseRectangle, mouseClickPoint)) {
MessageBox.Show(string.Format("the selected node text:{0}", e.Node.Text));
}
}
} /// <summary>
/// Return a value indicating whether the click point belong the reactangle region.
/// </summary>
/// <param name="baseRectangle"></param>
/// <param name="clickPoint"></param>
/// <returns></returns>
private static bool WasInBounds(Rectangle baseRectangle, Point clickPoint) {
bool result = true; int bottom = baseRectangle.Bottom;
int right = baseRectangle.Right;
int left = baseRectangle.Left;
int top = baseRectangle.Top; if ((clickPoint.X < left || clickPoint.X > right) || (clickPoint.Y > bottom || clickPoint.Y < top)) {
result = false;
} return result;
}

废话不多说,用过的人看了代码自然明白

Fixed 鸟粪一样的TreeView下的NodeMouseDoubleClick Bug的更多相关文章

  1. web移动端Fixed在Input获取焦点时ios下产生的BUG及处理

    1.现象 可以看到下面两张图,图1搜索框为fixed固定在顶部,滚动没有任何问题. 图2当光标进入搜索框时,ios自作聪明的把光标定位到中间,并且fixed属性被自动修改成了absolute.此时注意 ...

  2. ie6下常见的bug 调整页面兼容性

    ie6下常见的bug 我们布局页面,首先符合标准,如何写一个页面的标准性? 但是ie6等浏览器本身就比较特殊,bug比较多,兵法云,知己知彼百战百胜.我们需要了解ie6的一些常见bug,这样,更好的调 ...

  3. 高并发压力下导致数据库bug

    环境信息:  linux 6.1 + oracle11.2.0.3 RAC     问题现象: 学校晚上6点选课,人数大概有3000,7点时,数据库报错如下(数据库到6点多还是可以连接的),数据库hu ...

  4. 当fixed元素相互嵌套时chrome下父元素会影响子元素的层叠关系

    问题:fixed元素被另一个fixed元素包含的时候在chrome下fixed子元素的定位会受到父元素的影响. demo(http://jsbin.com/qumah/1): <!DOCTYPE ...

  5. duilib进阶教程 -- TreeView控件的bug (9)

    一.不自动调整子控件的宽度(TreeView宽度小于260时) 相信亲们用同样的代码,显示效果肯定和Alberl不一样吧~O(∩_∩)O~ 嘿嘿,仔细对比下,看看你们的列表头背景图片是下面这样的么? ...

  6. 记一次事件委托在 ios 下的兼容 bug

    项目中碰到的兼容类 bug,记录一二. 页面上有几个同类型的控件,点击它们会触发一些事件,很显然,事件委托优于批量绑定.为了图方便,我将 click 事件绑定到了 document.body 上(绑定 ...

  7. IE 下的z-index BUG问题

    今天做项目的时候在IE7 碰到了IE 的 z-index 问题: 然后问了几个朋友,总结了一下z-index问题的几个要点: 1.z-index 是要在position为relative或者absol ...

  8. 解决IE下z-index的bug

    IE下z-index有很奇葩的BUG,就是z-index级别不生效.解决方案只有在 该元素的父级元素添加 posotion和z-index,就能识别了. element{position:relati ...

  9. mac 下php运行bug

    如下所说bug在window下没有,在mac下存在. mac下的php报如下错误: fopen("data.json") Error: failed to open stream: ...

随机推荐

  1. unity中Debug输出控制

    1 需求: (1)选择在界面.console中输出,并且能够设置保存到文档 (2)控制debug是否输出,可以在debug模式下输出,release模式下不输出 2 参考: 谢谢雨松同学的博客:htt ...

  2. 纯CSS制作三角(转)

    原原文地址:http://www.w3cplus.com/code/303.html 原文地址:http://blog.csdn.net/dyllove98/article/details/89670 ...

  3. 页面静态化3 --- 伪静态技术之Apache的rewrite机制

      Apache的rewrite机制: 意思就是,你发送的地址,比如:http://localhost/news-id67.html会被Apache改写成http://localhost/news.p ...

  4. linux下svn的co如何排除目录

    某些原因想在svn co的时候排除某些目录,可以绕个圈子,分三步来完成: co外层目录: svn checkout --depth empty $URL [$LOCATION] 完成之后,会有一个只包 ...

  5. zero cycles - 1 to 30 cycles - tens of millions of cycles

    Computer Systems A Programmer's Perspective Second Edition To this point in our study of systems, we ...

  6. simplify the design of the hardware forming the interface between the processor and thememory system

    Computer Systems A Programmer's Perspective Second Edition Many computer systems place restrictions ...

  7. Android progressbar 详解

    [原文Android学习笔记(十六)进度条] ProgressBar XML属性 属性名 描述 android:animationResolution 超时的动画帧之间的毫秒 :必须是一个整数值,如“ ...

  8. Java ArrayListSerialise

    import java.io.*; import java.util.*; //ArrayListSerialise public class A { public static void main( ...

  9. 鸡肋的Drools

    在看过Drools例子之后,认为其太鸡肋. 完全可以用bshell脚本来代替,或者用java自带的脚本(java5以上才支持,不过不是太好用)代替. 规则文件还要学其新标签,与其配套的接口写那么多,还 ...

  10. phpCAS::handleLogoutRequests()关于java端项目登出而php端项目检测不到的测试

    首先,假如你有做过cas,再假如你的cas里面有php项目,这个时候要让php项目拥有cas的sso功能,你需要改造你的项目,由于各人的项目不同,但是原理差不多,都是通过从cas服务器获取sessio ...