Visual Basic now allows you to omit unused and unwanted arguments from your event handlers. The thought is that this will make for cleaner reading code. In addition, it allows you to assign methods directly to event handlers without trying to determine the proper event signature.
As an example, suppose you had the following code to respond to a button click event:
Private Sub Button1_Click(ByVal sender As System.Object, _
ByVal e As System.EventArgs) Handles Button1.Click
‘your code here
End Sub
You could remove the event handlers from this code (or never put them in). Your new
code would function the same and look as follows:
Private Sub Button1_Click() Handles Button1.Click
‘your code here
End Sub
Source of Information : Sams Microsoft Visual Studio 2008 Unleashed
As an example, suppose you had the following code to respond to a button click event:
Private Sub Button1_Click(ByVal sender As System.Object, _
ByVal e As System.EventArgs) Handles Button1.Click
‘your code here
End Sub
You could remove the event handlers from this code (or never put them in). Your new
code would function the same and look as follows:
Private Sub Button1_Click() Handles Button1.Click
‘your code here
End Sub
Source of Information : Sams Microsoft Visual Studio 2008 Unleashed
|
0 comments
Post a Comment