Hi Allan,
In VB.NET, the methods that you want to add your own code in the inherited class then you need to add a couple of attributes to the methods.
In the base class method, make sure the scope is NOT "Private". If only your inherited class will use the method, then use "Protected". You need to add the "Overridable" keyword. Then in the inherited method, use the "Overrides" keyword.
Protected Overridable Sub MyMethod()
End Sub
Protected Overrides Sub MyMethod()
End Sub
>Hi,
>
>I have created a sub-class of a web form ('clsSweepForm' in project 1).
>
>After creating a reference to the 'dll' from project 1 in project 2 - I am able to inherit the properties I created in 'clsSweepForm' - using 'WebForm1' in project 2.
>
>In other words, from Webform1, I can enter:
>
>
>Me.FormMode = "isAdding" 'where property FormMode was defined in 'clsSweepForm'
>
>
>Therefore, I am able to get at the properties of 'clsSweepForm' from WebForm1. Now, what I'd really like to do is do something that I have done in VFP for some time.
>
>In some of my VFP projects where similiar methods were required in multiple pages (i.e. Validate Input, Add a record, Delete a record, etc.) - I'd just create a form class and add these methods to the form class.
>
>For instance, I'd add a method called 'methodADD' in the form class. Then, in the VFP form based on this class, the method would be visible and I could enter the appropriate code.
>
>Is there a way to do this in VB.NET?
-----------------------------------------
Cathi Gero, CPA
Prenia Software & Consulting Services
Microsoft C# / .NET MVP
Mere Mortals for .NET MVP
cgero@prenia.comwww.prenia.comWeblog: blogs.prenia.com/cathi