Issues changing form's type to a custom base form type

◇◆丶佛笑我妖孽 提交于 2019-12-11 10:55:57

问题


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...

  1. add the base form's unit to the uses clause
  2. change class(TForm) to class(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

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!