How do i code an animated (gif) button in vb.NET?
-
i have 2 images and when mouse goes over 1 the other shows. how do i code it? i started out putting picture box. am i on the right way? im a rookie so plz be specific. thank you.
First you should reference "System.Drawing" by right clicking on references or add "Imports System.Drawing" to the top of your project. In the class name dropdown (above your code) choose the command button and next to that in the method name dropdown choose MouseHover/MouseLeave. Enter code similar to the following: Private Sub Button1_MouseHover(ByVal sender As Object, ByVal e As System.EventArgs) Handles Button1.MouseHover Button1.Image = Image.FromFile("D:\Source\App.ico") End Sub Private Sub Button1_MouseLeave(ByVal sender As Object, ByVal e As System.EventArgs) Handles Button1.MouseLeave Button1.Image = Image.FromFile("D:\Source\Add.ico") End Sub :)