您的位置:首页 > 其它

Button的放大与缩小

2008-07-16 10:01 69 查看
public Form1()

{

InitializeComponent();

bool enlarged = false;

button2.MouseEnter += delegate

{

if (!enlarged)

{

Rectangle rect = button2.Bounds;

rect.Inflate(5, 5);//放大指定量

button2.Bounds = rect;

enlarged = true;

}

};

button2.MouseLeave += delegate

{

if (enlarged)

{

Rectangle rect = button2.Bounds;

rect.Inflate(-5, -5);

button2.Bounds = rect;

enlarged = false;

}

};

}
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签: