G
Guest
Is anyone out there really using inheritance for serious code reuse in a
real-world setting? (As opposed to toy examples). I'm finding it to be so
unstable that it would literally take less time to code all the forms
individually. I'd be very curious to see if anyone else is having these
problems or if there is something that I am doing wrong. Or maybe it's a toy
feature that nobody's using. It's very possible that these are all designer
bugs. That would be good to know as well.
1. Forms inheritance. Intermittently, code changes to a base form (in a
separate project) are not reflected in the operation of derived forms. Full
rebuilds of both projects doesn't fix the problem. It's as if it's hanging to
a previous version of the DLL. Nothing less that recreating the form solves
the problem when this happens. There's no pattern that I can detect that
causes it to happen or not.
2. Inheriting controls from Forms classes. First of all, there doesn't seem
to be any way to do this in the designer. You have to inherit from
UserControl and then change it to the desired control by hand. Unfortunately,
once you do this it is no longer designable. Worse, again intermittently, if
try to open the derived control in the designer to modify properties after
you have made the change above, any forms which use the control will tank.
The declarations stay but the instantiation and addition of the control to
the form is missing (all in the designer-generated code). You either have to
create a new form or delete the declarations in the designer-generated code
and start over.
Aggravating in the extreme to say the least. Please tell me what I have to
do to make this work. Thanks!
real-world setting? (As opposed to toy examples). I'm finding it to be so
unstable that it would literally take less time to code all the forms
individually. I'd be very curious to see if anyone else is having these
problems or if there is something that I am doing wrong. Or maybe it's a toy
feature that nobody's using. It's very possible that these are all designer
bugs. That would be good to know as well.
1. Forms inheritance. Intermittently, code changes to a base form (in a
separate project) are not reflected in the operation of derived forms. Full
rebuilds of both projects doesn't fix the problem. It's as if it's hanging to
a previous version of the DLL. Nothing less that recreating the form solves
the problem when this happens. There's no pattern that I can detect that
causes it to happen or not.
2. Inheriting controls from Forms classes. First of all, there doesn't seem
to be any way to do this in the designer. You have to inherit from
UserControl and then change it to the desired control by hand. Unfortunately,
once you do this it is no longer designable. Worse, again intermittently, if
try to open the derived control in the designer to modify properties after
you have made the change above, any forms which use the control will tank.
The declarations stay but the instantiation and addition of the control to
the form is missing (all in the designer-generated code). You either have to
create a new form or delete the declarations in the designer-generated code
and start over.
Aggravating in the extreme to say the least. Please tell me what I have to
do to make this work. Thanks!