Form Inheritance controls Issue

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?
 
R

RJ

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
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top