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