我感觉Leave事件真烂,我本以为它一定要鼠标点中后,再移开鼠标才会激发,谁知道,我在旁边的几个控件上点来点去,也会激发这个事件,  怎么会这样子, 是不是微软的BUG.

解决方案 »

  1.   

    我改成如下代码,也不行, 问题是我根本就没有去碰bsasa这个combobox 控件,为什么会激发这个事件呢
     private void bsasa_MouseLeave(object sender, EventArgs e)
            {
                string sbe = bdate1.Value.ToShortDateString();
                string sen = bdate11.Value.ToShortDateString();
                sdc2.cleardt();
                string ssq3 = "select a.socode as 订单号,c.str2 as 客户,a.saleb as 合同号,a.salec as 销售类型,a.date2 as 交期,a.date4 as 线材完成日期,a.date3 as 成品完成日期,a.saled as 注意项,a.re1 as 备注," +
                        "b.sasa as 客户型号,b.inta as 项次,b.cinvcode as 编码,b.cinvname as 品名,b.cinvstd as 规格,b.intb as 数量,b.sasb as 单位," +
                        "b.sasc as 材质颜色,b.sasd as 连接器,b.sase as 印字,b.sasf as 接法及备注,b.sasg as 包装要求 " +
                        "from Dsale a left join Dsaleson b on a.socode=b.socode left join Dcustomer c on a.salea = c.codestr " +
                         "where b.sasa = '" + bsasa.Text + "' and a.date1 between '" + sbe + "' and '" + sen + "' ";
                dataGridView1.DataSource = sdc2.adt(ssq3);
            }
      

  2.   

    MouseLeave嘛
    看名字就知道是鼠标事件,和MouseMove,MouseEnter一家人的
    也就是说只要鼠标移过(离开)那个控件就会发生
    并不是像你“本以为”的那样
      

  3.   

    算了,我认定是微软的BUG,奶奶的,我更改成selectchange事件。