回复 2楼iceman的帖子
关于第一个问题,事件被
-
- flex.DoDragDrop(flex[hti.Row, 0].ToString(), DragDropEffects.All);
复制代码
吃掉了。
修改代码如下,把该方法在 mousemove 事件中调用:
- private void fg_MouseDown(object sender, MouseEventArgs e)
- {
- if (e.Button == MouseButtons.Left)
- {
- #region
- tncurrent = Convert.ToString(this.fg[fg.Row, fg.Col]);//先鼠标点击左键找到节点,在右键找到菜单
- if (e.Button == MouseButtons.Right)
- {
- if (tncurrent == null || tncurrent == "")
- {
- for (int i = 0; i < this.contextMenuStrip1.Items.Count; i++)
- {
- this.contextMenuStrip1.Items[i].Enabled = false;//当勤休入力画面上的树节点为空时,屏蔽右键菜单
- this.contextMenuStrip1.Items[i].Visible = false;
- }
- }
- else
- {
- for (int i = 0; i < this.contextMenuStrip1.Items.Count; i++)
- {
- this.contextMenuStrip1.Items[i].Enabled = true;//当勤休入力画面上的树节点不为空时,启用右键菜单
- }
- this.contextMenuStrip1.Items[1].Visible = true;
- this.LookInfo.Click += new System.EventHandler(this.LookInfo_Click);
- }
- }
- #endregion
-
- }
- }
- private void fg_MouseMove(object sender, MouseEventArgs e)
- {
- //20130710 直接拖拽代码加上后,节点的双击事件就失效了 ,麻烦查看下,多谢了
- if ((e.Button & MouseButtons.Left) == MouseButtons.Left)
- {
- C1.Win.C1FlexGrid.C1FlexGrid flex = sender as C1.Win.C1FlexGrid.C1FlexGrid;
- C1.Win.C1FlexGrid.HitTestInfo hti = flex.HitTest(e.X, e.Y);
- if (hti.Type == C1.Win.C1FlexGrid.HitTestTypeEnum.Cell)
- {
- flex.DoDragDrop(flex[hti.Row, 0].ToString(), DragDropEffects.All);
- }
- }
- }
复制代码 |