本文介绍了如何在我的网页中获取鼠标事件Args的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

Hello All,



我有一页GridView。现在我想拖放行。我搜索并发现了一些文章,并且他们已经给了MouseEventArgs ...我没有在我的网页中获得这些Args。我是否需要在我的网页上添加任何东西才能获得MouseEventArgs?



Hello All,

I have one page with GridView. Now I wanted to drag and drop of rows. I have searched and found some articles and in that they have given MouseEventArgs... I am not getting those Args in my web page. Do I need to add any thing to get MouseEventArgs on my web page?.

private void dataGridView1_MouseMove(object sender, MouseEventArgs e)
{
    if ((e.Button & MouseButtons.Left) == MouseButtons.Left)
    {
        // If the mouse moves outside the rectangle, start the drag.
        if (dragBoxFromMouseDown != Rectangle.Empty &&
            !dragBoxFromMouseDown.Contains(e.X, e.Y))
        {

            // Proceed with the drag and drop, passing in the list item.
            DragDropEffects dropEffect = dataGridView1.DoDragDrop(
                     dataGridView1.Rows[rowIndexFromMouseDown],
                     DragDropEffects.Move);
        }
    }
}





有任何建议请...



谢谢

Naveen。



Any suggestions please...

Thanks
Naveen.

推荐答案


这篇关于如何在我的网页中获取鼠标事件Args的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

10-22 18:52