超越期望
海滨的小屋

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;
                }
            };

        }

posted on 2008-07-16 10:01  Savior(海滨)  阅读(368)  评论(0编辑  收藏  举报