I´m using this code for move my panel in a windowform;
// variables used
private bool btnDown;
private int offsetX;
private int offsetY;
private void pnlOrder_MouseDown(object sender, MouseEventArgs e)
{
if (e.Button == MouseButtons.Left)
{
btnDown = true;
offsetX = e.X;
offsetY = e.Y;
}
}
private void pnlOrder_MouseUp(object sender, MouseEventArgs e)
{
if (e.Button == MouseButtons.Left)
{
btnDown = false;
}
}
private void pnlOrder_Move(object sender, EventArgs e)
{
if (btnDown)
{
pnlOrder.Left += e.X - offsetX;// here in e.X are you missing a using directive or an assembly reference? error
pnlOrder.Top += e.Y - offsetY;// and here e.Y
are you missing a using directive or an assembly reference?
}
}
what is wrong with e.X and e.Y????
Loading
Anonymous HacksPosted Apr 25, 2013, 10:03 PM
private void pnlorder_move(object sender, eventargs e)
to:
private void pnlorder_move(object sender, mouseeventargs e)
note:
i didnt put the caps in for the commands and u had it set to the pnl's event args such as move insted of the mouses args such as x,y positions
mind any spelling mistakes im abit lazy lol.
greg dorianPosted Apr 26, 2013, 9:16 AM