步骤如下:
1、拖一个TreeView控件到窗体
2、CheckBox设为True
3、用设计器随便添加一两个TreeNode
4、托一个ImageList到窗体
5、给ImageList选3张图片
6、TreeView的StateImageList属性选择刚拖的ImageList1 
7、F5运行XP下面随便怎么点复选框,只会出现两种图片,分别表示TreeNode.Checked的 true和false
Win7下,点慢点正常,但是快速点击的话会出现第三张图片。Win7下,如果ImageList选两张图片的话,就没这个现象。
但是我选3张图片是为了用sendMessage,实现三态TreeView的

解决方案 »

  1.   

    没试过
    你的VS 是什么版本如果是2008 有这个现象还是正常的,
    毕竟是 一个过渡到版本,和2003 有一堆问题一样
    相对来说,VS 2005 要比 2008 的问题少一些,2010 也还好
      

  2.   

    刚在vs2010 .net 4.0下试了
    问题依旧
      

  3.   


    这个是窗体设计器的代码,不过ImageList没有选图片,你要在自己电脑上选三张图片
    /// <summary>
            /// 设计器支持所需的方法 - 不要
            /// 使用代码编辑器修改此方法的内容。
            /// </summary>
            private void InitializeComponent()
            {
                this.components = new System.ComponentModel.Container();
                System.Windows.Forms.TreeNode treeNode1 = new System.Windows.Forms.TreeNode("节点0");
                System.Windows.Forms.TreeNode treeNode2 = new System.Windows.Forms.TreeNode("节点1");
                this.treeView1 = new System.Windows.Forms.TreeView();
                this.imageList1 = new System.Windows.Forms.ImageList(this.components);
                this.SuspendLayout();
                // 
                // treeView1
                // 
                this.treeView1.CheckBoxes = true;
                this.treeView1.Location = new System.Drawing.Point(87, 66);
                this.treeView1.Name = "treeView1";
                treeNode1.Name = "节点0";
                treeNode1.Text = "节点0";
                treeNode2.Name = "节点1";
                treeNode2.Text = "节点1";
                this.treeView1.Nodes.AddRange(new System.Windows.Forms.TreeNode[] {
                treeNode1,
                treeNode2});
                this.treeView1.Size = new System.Drawing.Size(201, 233);
                this.treeView1.StateImageList = this.imageList1;
                this.treeView1.TabIndex = 0;
                // 
                // imageList1
                // 
                this.imageList1.ColorDepth = System.Windows.Forms.ColorDepth.Depth8Bit;
                this.imageList1.ImageSize = new System.Drawing.Size(16, 16);
                this.imageList1.TransparentColor = System.Drawing.Color.Transparent;
                // 
                // Form1
                // 
                this.AutoScaleDimensions = new System.Drawing.SizeF(8F, 15F);
                this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
                this.ClientSize = new System.Drawing.Size(503, 396);
                this.Controls.Add(this.treeView1);
                this.Name = "Form1";
                this.Text = "Form1";
                this.ResumeLayout(false);        }        #endregion        private System.Windows.Forms.TreeView treeView1;
            private System.Windows.Forms.ImageList imageList1;
      

  4.   

    悲催   看来没有win7  ,还是幸福的
      

  5.   

    我没试过, 但是我的win7 没啥问题, 但是64 的就不可以了,64 位的系统我试了好多东西都能用 ,我很纠结
      

  6.   

    我觉得还是你设置的问题,我们公司的产品 VS 2008 做到 C/S 架构,窗体开发,目前还剩5个人开发,都是一个项目 ,3个人用WIN7 ,我用XP 都没啥问题
    所以 VS 在 WIN7 和 XP 是 不会有冲突的、
    你还是重新装下吧如果你WIN7下 只装的是 .NETFRAMWORK 建议 装个 开发环境 看看,是否还有问题,如果没有问题,说明还是你少装了东西