Hello there,
Many people may wonder how to theme your aplications in Visual Basic.NET and ill show you how.
First lets start a new project and we will call it themed buttons.

Make 3 buttons.

Now dubble click on the form and in the forms load put this code.
CODE
'Turns all the buttons into flat ones'
Button1.FlatStyle = FlatStyle.Flat
Button2.FlatStyle = FlatStyle.Flat
Button3.FlatStyle = FlatStyle.Flat
'Turns all the buttons backcolour to red'
Button1.BackColor = Color.Red
Button2.BackColor = Color.Red
Button3.BackColor = Color.Red
Now thats done we will add this code right under it remember we havent left the form load sub.
CODE
'Magical code that lets us add handlers'
For Teller As Integer = 0 To Controls.Count - 1
Dim Control As Control = Controls(Teller)
If Not Control.GetType() Is GetType(Button) Then
Continue For
End If
Dim ButtonControl As Button = Control
AddHandler ButtonControl.MouseEnter, AddressOf MyFunctionToTriggerOnMouseOver
AddHandler ButtonControl.MouseLeave, AddressOf MyFunctionToTriggerOnMouseLeave
AddHandler ButtonControl.MouseDown, AddressOf MyFunctionToTriggerOnMouseDown
AddHandler ButtonControl.MouseUp, AddressOf MyFunctionToTriggerOnMouseUp
Next
As you see we have errors.
Ok now we leave the sub and add 1 line and now type this code in this will fix the errors.
CODE
Public Sub MyFunctionToTriggerOnMouseOver(ByVal sender As System.Object, ByVal e As System.EventArgs)
Dim ButtonControl As Button = Sender
'Changes the color of the buttons to blue when the mouse is over it'
ButtonControl.BackColor = Color.Blue
End Sub
Public Sub MyFunctionToTriggerOnMouseLeave(ByVal sender As System.Object, ByVal e As System.EventArgs)
Dim ButtonControl As Button = Sender
'Changes the color back to red when the mouse leaves.'
ButtonControl.BackColor = Color.Red
End Sub
Public Sub MyFunctionToTriggerOnMouseDown(ByVal sender As System.Object, ByVal e As System.EventArgs)
Dim ButtonControl As Button = sender
'Changes the color to green when mouse goes down.'
ButtonControl.BackColor = Color.Green
End Sub
Public Sub MyFunctionToTriggerOnMouseUp(ByVal sender As System.Object, ByVal e As System.EventArgs)
Dim ButtonControl As Button = sender
'Changes the color to red when the mouse goes up'
ButtonControl.BackColor = Color.Red
End Sub
All the code should look about like this

Now the errors are gone!
Well now lets try this press the arrow on the quickbar to debug the program.
Now you can see and use this code in many ways to add handlers.
Credits:
ÄndrewGoethalsand any one else that I think helped me?