C
Cride
Hello,
I have this form Form_Report_Vacations which is inherited from
Form_Report_Shifts.
Form_Report_Shifts contains an event handler for a button named
cmd_Show.
In my inherited form i want to specify different behaviour for the
click event of the button.
I dont want the code that lies in the base class to execute at all.
I have done this in the base class event handler:
---------------------------------------------------------------------------------------------------------------
Private Sub cmd_Show_Click(ByVal sender As System.Object, ByVal e As
System.EventArgs) Handles cmd_Show.Click
' Exit sub if not in base class.
If CType(sender, Control).FindForm.Name <> "Form_Report_Shifts" Then
Exit Sub
End If
' More code
....
....
End Sub
---------------------------------------------------------------------------------------------------------------
This certainly works but it looks a little bit ugly in my opinion.
Is there a better way than this to prevent execution of code in the
event handler of the base class?
- Christian
I have this form Form_Report_Vacations which is inherited from
Form_Report_Shifts.
Form_Report_Shifts contains an event handler for a button named
cmd_Show.
In my inherited form i want to specify different behaviour for the
click event of the button.
I dont want the code that lies in the base class to execute at all.
I have done this in the base class event handler:
---------------------------------------------------------------------------------------------------------------
Private Sub cmd_Show_Click(ByVal sender As System.Object, ByVal e As
System.EventArgs) Handles cmd_Show.Click
' Exit sub if not in base class.
If CType(sender, Control).FindForm.Name <> "Form_Report_Shifts" Then
Exit Sub
End If
' More code
....
....
End Sub
---------------------------------------------------------------------------------------------------------------
This certainly works but it looks a little bit ugly in my opinion.
Is there a better way than this to prevent execution of code in the
event handler of the base class?
- Christian