J
jrhoads23
I have been wondering this for some time. If I create my own class
inherited from an existing class or create a user control, should I be
overriding the OnFontChanged method (or similar) or capturing the
FontChanged event. It seems they both get the same accomplished - so
what is the difference between the two? Which should I be using?
For example, lets say I create a class MyButton which inherits
System.Windows.Forms.Button. Which should I use...
Protected Overrides Sub OnPaint(ByVal e As
System.Windows.Forms.PaintEventArgs)
' my code here
MyBase.OnPaint(e)
End Sub
---OR---
Private Sub Me_Paint(ByVal sender As Object, ByVal e As
System.Windows.Forms.PaintEventArgs) Handles MyBase.Paint
' my code here
End Sub
inherited from an existing class or create a user control, should I be
overriding the OnFontChanged method (or similar) or capturing the
FontChanged event. It seems they both get the same accomplished - so
what is the difference between the two? Which should I be using?
For example, lets say I create a class MyButton which inherits
System.Windows.Forms.Button. Which should I use...
Protected Overrides Sub OnPaint(ByVal e As
System.Windows.Forms.PaintEventArgs)
' my code here
MyBase.OnPaint(e)
End Sub
---OR---
Private Sub Me_Paint(ByVal sender As Object, ByVal e As
System.Windows.Forms.PaintEventArgs) Handles MyBase.Paint
' my code here
End Sub