...display a long path as c:...pathfile.txt?

Author: Simon Grossenbacher
Homepage: http://www.swissdelphicenter.ch

Category: Files

{
 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;

 

printed from
www.swissdelphicenter.ch
developers knowledge base