Animating your VB.Net Form
By Tanaya Karmakar
Here i have written a funny programm that will animate the VB.Net main form. Basically The form will go on increasing in its size.
Create a new form and add two buttons on it. change the caption as Continue and Exit. Clicking on continue will animate the form.
The Form design will look as follows:
The full code will look like as follows. Add it to the programme.
Public Class Form1
Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
Dim h, w As Integer
h = Me.Height
w = Me.Width
Me.BackColor = Drawing.Color.Blue
While (h < 700 And w < 700)
h += 1
Me.Height = h
w += 1
Me.Width = w
End While
End Sub
Private Sub Button2_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button2.Click
Me.Close()
End Sub
End Class
Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
Dim h, w As Integer
h = Me.Height
w = Me.Width
Me.BackColor = Drawing.Color.Blue
While (h < 700 And w < 700)
h += 1
Me.Height = h
w += 1
Me.Width = w
End While
End Sub
Private Sub Button2_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button2.Click
Me.Close()
End Sub
End Class
Now when you run it you will get the output as follows. If you like this programe then don't forget to leave your comments...!
Its a splendid website here. Thanks a lot for comming up with such a nice website.
ReplyDeleteI want to run this programe in PC where Dotnet not installed , will it work? If yes then how?
-Harvindar,Kolkata
Hm....!Bhalo program...!
ReplyDeleteI am Kanika Dey from Haldia.
ReplyDeleteI am a regular follower of your blog and i am also a member of hackingheart. This is an excellent site.You have done a great job.
I am new to Dot net programming. In my PC your programe is not running properly even though there is no error. The VB form not animating.
What could be the reasons?
Good programme. Its simple and logic is also good. Keep it up.
ReplyDeleteThanks everybody for your valuable comments.
ReplyDeleteif the Dotnet is not installed,it will not work.
In reply to Kanika i will say that i have tested this program on dotnet 3.5 Framework.
Its running fine and form is animating.
I think you have made some logical errors.
Check ur code properly.
Thanks