Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations derfloh on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

How to fit filename into Rect? 1

Status
Not open for further replies.

TimSNL

Programmer
Sep 11, 2001
119
AU
Hello.

I am writing a fileneme to canvas using TextRect.
Does anyone have the function to cut down the filename to fit into the Rect, adding dots in the midddle as needed?

Thanks for you help.
Tim
 
The MinimizeName function should do what you want. It is in the FileCtrl unit.

Example:
Code:
uses FileCtrl;
...
...
var
  fileName: string;
  miniName: string;
begin
  fileName := 'c:\data\movies\catalog.db';
  miniName := MinimizeName ( fileName, Form1.Canvas, 40 );
  ...
end;

Andrew
Hampshire, UK
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top