下面的代码供参考,在移出第3列时触发,实际上是在move时用hittest来判断移动之前和之后鼠标所处的位置
- c1FlexGrid1.MouseMove += C1FlexGrid1_MouseMove;
- HitTestInfo info=new HitTestInfo();
- private void C1FlexGrid1_MouseMove(object sender, MouseEventArgs e)
- {
-
- if (info.Column == 2)
- {
- info = c1FlexGrid1.HitTest(e.X, e.Y);
- if (info.Column != 2)
- MessageBox.Show("移动出了第二列");
- }
- info = c1FlexGrid1.HitTest(e.X, e.Y);
- }
复制代码 |