ByVal sender As System.Object??? WHAT THE??
By now you have probably seen the sender parameter in events and wondered what in the world it is. Well in .NET, controls can now share events. Because of this sender becomes a reference to the object that called the event. So if TextBox1 fired the event sender will be TextBox1. Therefor eif you want to change the text of that textbox in that event, you can just say
Code:
sender.Text = "Blah"
I will cover sharing events later.
Setting a variable when you declare it.
A not all that spectacular but highly requested feature in VB .NET is the ability to assign a value to a variable when it is declared. Now you can do it.
Code:
Dim myString As String = "Hello"
Again not all that special but since it is a new feature, I added it to the tips.
Multiple Subs/Functions with same name/different parameters?
Yes you can now do this highly requested addition to VB .NET.
Lets say you have 2 subs that have the same name, but the parameters are different
Code:
Sub Test(myString As String)
End Sub
Sub Test(myInteger As Integer)
End Sub
When you call the sub test, depending on what type of value you pass into it, it WILL run the correct Subroutine.