|
-
Nov 28th, 2003, 10:50 AM
#1
Thread Starter
Lively Member
visual inheritance subclass problem
Hello everybody,
I have a problem with my visual inheritance.
In my base class, I have my constructor :
Code:
Public Sub New()
MyBase.New()
'This call is required by the Windows Form Designer.
InitializeComponent()
BindData()
End Sub
Now I want to call each time my binddata subroutine which is overridable in my subclasses.
The problem is when I do this and I follow my traject step by step, then I pass first the constructor of the base form. Then I go to the overridden binddata class in my subform which binds an object to my textboxes. The problem is that it goes to the overridden class which tries to bind to textboxes which doesn't exist yet cause the initializecomponent from my inherited form hasn't run yet.
Does anyone know a workaround for this ? If it isn't clear, just ask it and I'll try to explain it better.
I've found an article on MS about it, but not a workaround. I think I just need to drop my constructor on my base class and call the subroutine(s) in my derived classes. But this isn't what I want at all I just want to declare it once in my parent class.
http://msdn.microsoft.com/library/de...nheritance.asp
Thanks,
Bjorn
Last edited by Borry; Nov 28th, 2003 at 12:28 PM.
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|