{
Set the label autosize property to false and set the property width
to the max. displayed length
}
uses FileCtrl;
procedure TForm1.Button1Click(Sender: TObject); begin
if Opendialog1.Execute then label1.Caption := MinimizeName(Opendialog1.FileName,
label1.Canvas, label1.Width); end;