Delphi Method Hides Virtual Method
Posted: January 25, 2026 | Categories: Delphi
I was doing some coding this morning in Delphi and encountered the following warning in the compiler output:
doClose method hides virtual method of base type 'TCustomForm'
I recently created a local procedure called doClose that did some cleanup before the application closes and I never considered that that procedure name conflicted with something else used internally by the application.
It turns out that Delphi's Vcl.Forms.TCustomForm has a DoClose method and I created a potential conflict by using it.
I renamed my procedure to doClosingStuff and the warning went away.
If this post helps you in some way, please consider buying me a coffee.