I want to shorten a filename to fit in a TEdit, something like
Edit1.Text := MinimizeName(FileName, Edit1.Canvas, Edit1.Width);
Unfortunately this doesn't compile because a TEdit does have a Canvas
property directly. The canvas is needed for its font metrics.
How can I access a TEdit's canvas?
(MinimizeName
is declared in Vcl.FileCtrl.)