Public Class SubClassedForm Inherits BaseClasses.BaseForm Public Sub MyPreClickCode(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles BaseCommandButton1.PreClick MsgBox("Preclick") ' Subsequent code determines that we don't want to do the default ' First cast the sender object to your Button base class and call it MyButton ' I don't know the syntax of this in VB, but I'm sure you do <g> MyButton.DoDefault = false End Sub Public Sub MyPostClickCode(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles BaseCommandButton1.PostClick MsgBox("PostClick") End Sub End ClassThen in your Button base class, add the property and check it before doing the default
Public Class BaseCommandButton Inherits System.Windows.Forms.UserControl ' Whatever the VB syntax is for a public property: Public bool DoDefault = true Public Event PreClick As EventHandler Public Event PostClick As EventHandler Private Sub BaseButton_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles BaseButton.Click RaiseEvent PreClick(sender, e) '------------------default code goes here--------------------- If DoDefault Then MsgBox("parent click at class level") End If '------------------default code goes here--------------------- RaiseEvent PostClick(sender, e) End Sub End Class~~Bonnie