שתף באמצעות


how to rotate button

Question

Saturday, May 11, 2019 4:29 PM

hi

I want a way with code  in mouse move and timer  to rotate the close button

All replies (5)

Monday, May 13, 2019 6:46 AM ✅Answered | 1 vote

Hi,

If you want to implement the rotation of the Button in winform, see the link below.

https://social.msdn.microsoft.com/Forums/en-US/1b9b7838-74bc-4d62-8c42-3ceb26282e81/how-to-rotate-button-vbnet?forum=vbgeneral

add code:

 AddHandler Button1.MouseMove, AddressOf PictureBox_Move

Public Sub PictureBox_Move()
            Timer1.Enabled = True
    End Sub
 Private Sub Timer1_Tick(sender As Object, e As EventArgs) Handles Timer1.Tick
        If Angle <= 360 Then
            InitializeButton(Button1, CSng(Angle))
            Angle += 30
        End If

    End Sub

Best Regards,

Alex

MSDN Community Support Please remember to click "Mark as Answer" the responses that resolved your issue, and to click "Unmark as Answer" if not. This can be beneficial to other community members reading this thread. If you have any compliments or complaints to MSDN Support, feel free to contact MSDNFSF@microsoft.com.


Saturday, May 11, 2019 6:46 PM | 2 votes

You can rotate controls with Storyboard Class


Saturday, May 11, 2019 10:44 PM

hi

I want a way with code  in mouse move and timer  to rotate the close button

Could you tell me why ? 

Why do you want doing this action to close button ?

I think if you made it moves up and down 3 or 4 times it will be better than rotation ....  

Regards From Egypt


Monday, May 13, 2019 6:54 AM

If you want to implement the rotation of the Button in winform, see the link below.

The mentioned Storyboard class is the right method, with perfect animation (hardware accelerated)


Monday, May 13, 2019 2:21 PM

hi

I want a way with code  in mouse move and timer  to rotate the close button

Is this a Windows Form or a WPF App?

Search Documentation

SerialPort Info

Multics - An OS ahead of its time.

 "Those who use Application.DoEvents have no idea what it does

    and those who know what it does never use it."    former MSDN User JohnWein