S
Steve
I have an app that requires the user to drag around small images - a bit
like the solitaire app. I'm doing it through the mousedown/mouseup and
mousemove events. It works but not as smoothly as the solitaire app. Is
there another technique that I should probably be looking at. Thanks in
advance - below is how I'm currently doing it(c#).
Steve.
private void MouseDownHandler(object sender,
System.Windows.Forms.MouseEventArgs e)
{
bDrag = true;
_X = e.X;
_Y = e.Y;
}
private void MouseMoveHandler(object sender,
System.Windows.Forms.MouseEventArgs e)
{
if (bDrag)
{
((System.Windows.Forms.PictureBox) sender).Location = new
System.Drawing.Point(((System.Windows.Forms.PictureBox) sender).Left + e.X -
_X , ((System.Windows.Forms.PictureBox) sender).Top + e.Y - _Y);
}
}
private void MouseUpHandler(object sender,
System.Windows.Forms.MouseEventArgs e)
{
bDrag = false;
}
like the solitaire app. I'm doing it through the mousedown/mouseup and
mousemove events. It works but not as smoothly as the solitaire app. Is
there another technique that I should probably be looking at. Thanks in
advance - below is how I'm currently doing it(c#).
Steve.
private void MouseDownHandler(object sender,
System.Windows.Forms.MouseEventArgs e)
{
bDrag = true;
_X = e.X;
_Y = e.Y;
}
private void MouseMoveHandler(object sender,
System.Windows.Forms.MouseEventArgs e)
{
if (bDrag)
{
((System.Windows.Forms.PictureBox) sender).Location = new
System.Drawing.Point(((System.Windows.Forms.PictureBox) sender).Left + e.X -
_X , ((System.Windows.Forms.PictureBox) sender).Top + e.Y - _Y);
}
}
private void MouseUpHandler(object sender,
System.Windows.Forms.MouseEventArgs e)
{
bDrag = false;
}