Hi everyone,
I am developing a windows based application in VS2005. I want all my form to be inherits from one of my class e.g.ParentClass but indeed the windows forms already inherits windows.forms.form class. what I have tried is that, I inherit "windows.forms.form" in "ParentClass" and all forms inherits my "ParentClass". But in this case when I view the design of the form IDE gives error. Please guide my in this regard.
Thanks and Regards
Loading
Sam HobbsPosted Feb 23, 2010, 10:32 PM
Then if I understand you, you want something such as:
Note that Form1 is a partial class; you need to do the "Form1 : ParentClass" in more than one place.
Now that I think about it, that is probably not your problem. Probably what is happening is that you have ParentClass defined near the top of the file, before the Form1 class, or whatever the form class is called. You just have to move the ParentClass so it is after the form class; do you understand?
If none of that helps, then please be more specific about the problem.
Sam HobbsPosted Feb 24, 2010, 2:42 AM
I did not notice originally that you posted the question in the VB forum, so it is good that you figure it out anyway.
MaverickPosted Feb 24, 2010, 12:15 AM
your direction really helped :)
What i did is that i wrote
"Public Class Form1
Inherits Parent"
in both the class and designer as well.
in addition to that i also build the project. and its All fine now :)
Thanks