J
Joe Fallon
I have a WinForm that is a Base class. It has many controls on it and a lot
of generic code behind.
When I inherit the form I override 5 methods and now each child form has the
same look and feel and functionality. This part all works fine.
(I learned this morning that if you override a method that also has an Event
Handler then you should NOT include the event handler a 2nd time. I had a
devil of a time figuring out why a block of code was running twice!)
My question concerns one of my child methods.
It is very generic except for one thing - each child form declares a Private
variable named "list" which is a strongly typed collection of business
objects. This variable is used in the child procedure.
Is there any way to "move" this generic procedure to the Base class and yet
still know which strongly typed collection to use? When I try to copy the
code to the Base class VS underlines the "list" variable - which I would
expect since the Base form does not see the variable declared in the child.
Thanks for clarifying this for me.
of generic code behind.
When I inherit the form I override 5 methods and now each child form has the
same look and feel and functionality. This part all works fine.
(I learned this morning that if you override a method that also has an Event
Handler then you should NOT include the event handler a 2nd time. I had a
devil of a time figuring out why a block of code was running twice!)
My question concerns one of my child methods.
It is very generic except for one thing - each child form declares a Private
variable named "list" which is a strongly typed collection of business
objects. This variable is used in the child procedure.
Is there any way to "move" this generic procedure to the Base class and yet
still know which strongly typed collection to use? When I try to copy the
code to the Base class VS underlines the "list" variable - which I would
expect since the Base form does not see the variable declared in the child.
Thanks for clarifying this for me.