Form Inheritance controls Issue

  • Thread starter Thread starter Nancy
  • Start date Start date
N

Nancy

I have created a template form which contains edit, add,
cancel buttons and each button has some properties sets.

I have inherited the form to another form. I can see the
buttons from the parent form and the properties worked.

How could I add more code in each button for this new form?
 
baseform.vb - compile to library assembly ( dll)

Imports System.Windows.Forms

Public Class base
Inherits System.Windows.Forms.Form


Public Overridable Sub Button1_Click(ByVal sender As System.Object,
ByVal e As System.EventArgs) Handles Button1.Click
Button1PreClick()
MessageBox.Show("Base Button1_Click")
End Sub

Public Overridable Sub Button1PreClick()
MessageBox.Show("Base PreClick ")
End Sub
End Class


DerivedForm.vb - windows application project references the above
baseform.dll

Imports System.Windows.Forms


Public Class Form1
Inherits baseform.base

Public Overrides Sub Button1PreClick()

' This form's local implementation will be called by the base
Button1_Click.
MessageBox.Show("Form1 PreClick")
End Sub
End Class
 
Back
Top