1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38
|
private void FormPrincipal_MouseMove(object sender, MouseEventArgs e)
{
if (selection == 1)
{
//mouvement actif
if (move == 0)
{
move = 1;
Size grilleSize = new Size(ClientSize.Width - gaucheX - droiteX, ClientSize.Height - hautY - basY);
Size celluleSize = new Size(grilleSize.Width / nbJours, (grilleSize.Height / nbCreneaux) * rendezVousSelect.Duree);
//Point coinGrille = new Point(gaucheX, hautY);
rectangleCourant = new Rectangle(e.Location, celluleSize);
Rectangle rGrille = new Rectangle(gaucheX + celluleSize.Height, hautY + celluleSize.Width, grilleSize.Width , grilleSize.Height );
Cursor.Clip = rGrille;
Cursor = Cursors.SizeAll;
Control senderControl = (Control)sender;
Rectangle screenRectangle = senderControl.RectangleToScreen(rectangleCourant);
ControlPaint.DrawReversibleFrame(screenRectangle, Color.Black, FrameStyle.Thick);
ControlPaint.DrawReversibleFrame(screenRectangle, Color.Black, FrameStyle.Thick);
;
}
move = 0;
}
}
} |
Partager