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. Yii源码阅读笔记(十二)

    Action类,控制器中方法的基类: namespace yii\base; use Yii; /** * Action is the base class for all controller ac ...

  2. 大话数据结构(五)(java程序)——顺序存储结构的插入与删除

    获得元素操作 对于线性表的顺序存储结构来说,我们要实现getElement操作,即将线性表的第i个位置元素返回即可 插入操作 插入算法思路: 1.如果插入位置不合理,抛出异常 2.如果插入表的长度大于 ...

  3. instruction-set architecture Processor Architecture

    Computer Systems A Programmer's Perspective Second Edition We have seen that a processor must execut ...

  4. memache session

    Memcache和PHP memcach扩展安装请见http://koda.iteye.com/blog/665761 设置session用memcache来存储 方法I: 在 php.ini 中全局 ...

  5. go access database demo

    package main import ( "database/sql" "fmt" _ "github.com/lib/pq" " ...

  6. 【No.3 Ionic】超级逗表情 App

    本人使用Ionic框架开发了一个 超级逗表情 的App 依赖插件 cordova-plugin-app-version 0.1.9 "AppVersion" cordova-plu ...

  7. java开发bug 在启动Tomcat 6.0时发现第一条信息便是

    MyEclipse 8.5 + tomcat6 + jdk 1.8 启动的时候报错: The APR based Apache Tomcat Native library which allows o ...

  8. Bluetooth GAP介绍

    目录 1 GAP协议栈 2 Profile Role 3 用户接口 4 模式 5 安全 5.1 认证(Authentication) 5.2 安全模式 6 Idle Mode Procedures 7 ...

  9. Difference Search Path

    1.Framework Search Path           where to search frameworks (.framework bundles) in addition to sys ...

  10. JSON数据转换为字典型

    -(NSDictionary *)parseJSONStringToNSDictionary:(NSString *)JSONString {    NSData *JSONData = [JSONS ...