I want to rotate 2 buttons similar to how you do it in powerpoint so that if the mouse goes over the button, it raises the mouseover event. I know how the event handler stuff works, but I have no idea how to rotate my button. Specifically, I want it to rotate about 15 degrees every half second on a timer.

Anyone know how to do this?

Recommended Answers

All 4 Replies

I'm not seeing how this could be possible though out of curiosity, what's the goal of this?

I'll be honest I've never seen this type of 'animation' on a button before... that being said, does the physical BUTTON need to rotate? or just the 'visible' button component?

If the latter, perhaps a simple graphical overlay on the button which has an animated alternate graphic for when the mouseover hits it. Only drawback is, should you want the button to stay in the position it was in when the mouse leaves the mouseover then you're in a bit of trouble with that method.

Dunno what else to suggest to be honest, sorry.

I'm not sure if it can be translated to a control, but ddanbe posted a snippet a while back that rotated a string with a timer. See if it inspires you :)

Thanks for your posts. As far as I can tell, the easiest (and probably only) way to do what I want is to have another type of control that can rotate, and use it's mouseover event. anyone know any other controls that can be rotated in code?

Purpose of this is for me to learn more about c# and its capabilities. This project is a simple game.

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.