问题
I have a number of existing forms which I need to convert to inherit from another base form TfrmBase
instead of the normal TForm
. This base form is a TForm
with a little added functionality. All I do to convert them is...
- add the base form's unit to the uses clause
- change
class(TForm)
toclass(TfrmBase)
.
When I run the application, the FormCreate
even is executed successfully, but when it comes to showing this form (application's main form), I get an exception:
Class TPanel not found
I do in fact have a panel on this form which was converted. The uses clause does in fact have Vcl.ExtCtrls
added to it, where the TPanel
comes from.
What do I need to do to fix this? Am I doing the right steps to convert these forms?
回答1:
I found out my problem while I was typing this question, which probably no one else would have thought to point out...
All I had to do is remove this base form from the automatically created forms, and it worked. Something I should have done in the first place.
来源:https://stackoverflow.com/questions/19040956/issues-changing-forms-type-to-a-custom-base-form-type