Create Animated Button

前端 未结 2 1165
日久生厌
日久生厌 2021-02-04 19:02

I have button it possible create animate on click?

\"enter

with photoshop i have c

2条回答
  •  轮回少年
    2021-02-04 19:45

    It looks like you mentioned WinForms so I'll address that. Yes animation is possible but in general it's going to be a bit of work.

    There appears to be an implementation of a general purpose animation framework (although limited) over on CodeProject. In the comments schallos posted a better implementation of the reflection code using expression trees.

    The general principle is:

    • Use a PictureBox so you get double buffering
    • Use a timer control to control repainting (calling Invalidate() on your PictureBox)
    • You'll probably want to add some easing into the animation so it appears smoother; a bit of acceleration added to it when the user clicks goes a long way.

提交回复
热议问题