当前位置: 代码迷 >> ASP.NET >> .net怎么根据当前鼠标的坐标位置来打开新的窗口,用
  详细解决方案

.net怎么根据当前鼠标的坐标位置来打开新的窗口,用

热度:5934   发布时间:2013-02-25 00:00:00.0
.net如何根据当前鼠标的坐标位置来打开新的窗口,急用
.net如何根据当前鼠标的坐标位置来打开新的窗口,急用
谢谢大家了
------解决方案--------------------------------------------------------
帮顶!!!!
------解决方案--------------------------------------------------------
问题补充一下,就是在一个gridview控件里,点击里面表格时,就获得当前鼠标的坐标位置,那么在新窗口打开,这个功能怎么实现
------解决方案--------------------------------------------------------
JS获取鼠标位置

客户端的事情要用客户端的脚步来实现


------解决方案--------------------------------------------------------
楼上正确,
不过为什么要用新窗口??
用弹出层不更好吗??
------解决方案--------------------------------------------------------
        private void dataGridView1_MouseDown(object sender, MouseEventArgs e)
        {
            DataGridView.HitTestInfo hi= this.dataGridView1.HitTest(e.X, e.Y);

            if (hi.RowIndex== -1 
------解决方案--------------------------------------------------------
 hi.ColumnIndex== -1)
                return;

            this.dataGridView1.ClearSelection();//取消选中项
            this.dataGridView1.Rows[hi.RowIndex].Cells[hi.ColumnIndex].Selected = true;//选中单元格
              if (e.Button == MouseButtons.Left)
            {
                object content = this.dataGridView1.Rows[hi.RowIndex].Cells[hi.ColumnIndex].Value;
                if (content != null)
                {
                    Form f = new Form();
                    f.StartPosition = FormStartPosition.Manual;
                    f.Location = this.PointToScreen(new Point(e.X, e.Y)); 
                    f.Show();                    
                }
            }
        }
------解决方案--------------------------------------------------------
有没有具体的事例贴出来参考一下!!!!!!!!!!!
  相关解决方案