.NET
プログラミングを学ぼうとしています。学習の一環として、ボタンにいくつかの効果を加えようとしました。それは機能しています...しかし、私が想像したほどスムーズではありません! これを行うより良い方法はありますか?前もって感謝します!
私の必要性:
3つのボタンがあります。いずれかの上にマウスを置くと拡大し、そのボタンからマウスを離すと元のサイズに戻ります。
private void button1_MouseHover(object sender, EventArgs e)
{
button1.BackColor = Color.White;
button1.Width = 130;
button1.BringToFront();
}
private void button1_MouseLeave(object sender, EventArgs e)
{
button1.BackColor = Color.Red;
button1.Width = 75;
}
private void button2_MouseHover(object sender, EventArgs e)
{
button2.BackColor = Color.Gray;
button2.Width = 130;
button2.BringToFront();
}
private void Form1_MouseLeave(object sender, EventArgs e)
{
button2.BackColor = Color.Red;
button2.Width = 75;
}
private void button3_MouseHover(object sender, EventArgs e)
{
button3.BackColor = Color.DimGray;
button3.Width = 130;
button3.BringToFront();
}
private void button3_MouseLeave(object sender, EventArgs e)
{
button3.BackColor = Color.Red;
button3.Width = 75;
}