c#中button的坐标问题

2024-12-21 13:47:00
推荐回答(1个)
回答1:

int MoveJL=10;
int OldTop;
private void button1_MouseMove(object sender, MouseEventArgs e)
{
button1.Top = OldTop+MoveJL;
}

private void Form1_Load(object sender, EventArgs e)
{
OldTop = button1.Top;
}

private void button1_MouseLeave(object sender, EventArgs e)
{
button1.Top = OldTop;
}