Ejemplo n.º 1
0
        private void btnMouseDown(object sender, MouseEventArgs e)
        {
            PuzzleButton btn = (PuzzleButton)sender;

            if (vrsta)
            {
                if (btn.Text != "")
                {
                    moveBtn = btn;
                    Bitmap bit = new Bitmap(50, 50);
                    moveBtn.DrawToBitmap(bit, new Rectangle(Point.Empty, bit.Size));
                    moveCursor     = new Cursor(bit.GetHicon());
                    Cursor.Current = moveCursor;
                    DoDragDrop(this, DragDropEffects.Move);
                }
            }
            else if (btn.Image != null)
            {
                moveBtn = btn;
                Bitmap bit = new Bitmap(50, 50);
                moveBtn.DrawToBitmap(bit, new Rectangle(Point.Empty, bit.Size));
                moveCursor     = new Cursor(bit.GetHicon());
                Cursor.Current = moveCursor;
                DoDragDrop(this, DragDropEffects.Move);
            }
        }