OnResize method

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

Hello

Could somebody please explain the purpose of the following line of code

OnResize(EventArgs.Empty

Thanks and Best Regards
David Morris
 
* =?Utf-8?B?RGF2aWQgTW9ycmlz?= said:
Could somebody please explain the purpose of the following line of code?

OnResize(EventArgs.Empty)

Where is the method called?
 
David said:
Sorry I should've included this. The method is within the following
sub:

Private Sub RB_CheckedChanged(ByVal sender....,ByVal e...) Handles
rbPicture.CheckedChanged, rbText.CheckedChanged If
rbPicture.Checked Then Timer1.Interval = Picture_Interval
ElseIf rbText.Checked Then
Timer1.Interval = Text_Interval
End If

OnResize(EventArgs.Empty)
End Sub

It's part of standard programming pattern in .Net. Instead of raising an
event directly, a method is defined called On<Eventname> that raises the
event. This method is defined protected so it can also be used by child
classes to handle the event without the overhead of delegates.
So the call raises the Resize event. Why this codes wants to do that at this
point I don't know. ^_^
 
Back
Top