Recent

Author Topic: [solved] method is hidden by "BeforeDestruction;"  (Read 203 times)

Nicole

  • Hero Member
  • *****
  • Posts: 583
[solved] method is hidden by "BeforeDestruction;"
« on: November 29, 2022, 04:28:55 pm »
Msg=An inherited method is hidden by "BeforeDestruction;"
In my event the last line says "inherited".

How to deal better with this warning?

This it looks alike

Code: Pascal  [Select][+][-]
  1. procedure TFrame_COT.BeforeDestruction;
  2. begin    
  3.  
  4.    Optionen.Write_OptionZahl('Frame_COT', 'ware', RadioGroup_COT.ItemIndex);
  5.  
  6.    Optionen.Write_OptionDatum('Frame_COT', 'Anfang',DateTimePicker_Anfang.Date);
  7.    Optionen.Write_OptionDatum('Frame_COT', 'Ende', DateTimePicker_Ende.Date);
  8.   inherited;
  9.  
  10. end;
« Last Edit: November 29, 2022, 05:58:10 pm by Nicole »

wp

  • Hero Member
  • *****
  • Posts: 10454
Re: method is hidden by "BeforeDestruction;"
« Reply #1 on: November 29, 2022, 04:47:55 pm »
BeforeDestruction is inherited from TControl to be public. Your overridden method probably is protected and thus less visible. Move it into "public" and it will be fine.

Bart

  • Hero Member
  • *****
  • Posts: 4878
    • Bart en Mariska's Webstek
Re: method is hidden by "BeforeDestruction;"
« Reply #2 on: November 29, 2022, 05:36:14 pm »
More likely you did not declare this method as override;.
If you lowe visibility, you get a different messag from the compiler (I think, but I may be wrong).

Bart

Zvoni

  • Hero Member
  • *****
  • Posts: 1591
Re: method is hidden by "BeforeDestruction;"
« Reply #3 on: November 29, 2022, 05:40:30 pm »
More likely you did not declare this method as override;.
If you lowe visibility, you get a different messag from the compiler (I think, but I may be wrong).

Bart
Wouldn’t the ancestors event handler be declared virtual in this case?
One System to rule them all, One Code to find them,
One IDE to bring them all, and to the Framework bind them,
in the Land of Redmond, where the Windows lie
---------------------------------------------------------------------
Code is like a joke: If you have to explain it, it's bad

Nicole

  • Hero Member
  • *****
  • Posts: 583
Re: method is hidden by "BeforeDestruction;"
« Reply #4 on: November 29, 2022, 05:57:55 pm »
override;
was missing

 

TinyPortal © 2005-2018