Autor Beitrag
Crowbar
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starontopic star
Beiträge: 180

WinXP, SP2
D6 Enterprise
BeitragVerfasst: Sa 19.02.05 17:42 
Hi,
irgendwie habe ich es in der Suche nicht gefunden, aber vielleicht kann mir jemand einen Tip geben.

Ich lese in einer Labelkomponente ein Verzeichnis aus. Da das Verzeichnis auch einmal sehr lang sein kann, möchte ich die Verzeichnisanzeige "verkürzt" darstellen.
Zum Beispiel von
C:\WINDOWS\system32\config\systemprofile\Startmenü
in
C:\WINDOWS\system32\config\...\Startmenü
wandeln.

Cu
Crowbar
Keldorn
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starontopic star
Beiträge: 2266
Erhaltene Danke: 4

Vista
D6 Prof, D 2005 Pro, D2007 Pro, DelphiXE2 Pro
BeitragVerfasst: Sa 19.02.05 18:23 
MinimizeName ist die Funktion, die du suchst.

Mfg Frank

_________________
Lükes Grundlage der Programmierung: Es wird nicht funktionieren.
(Murphy)
Crowbar Threadstarter
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starontopic star
Beiträge: 180

WinXP, SP2
D6 Enterprise
BeitragVerfasst: Sa 19.02.05 18:37 
Hi Frank,
ja, genau diese Funktion habe ich gesucht! :D

Vielen Dank!

Cu
Crowbar
Crowbar Threadstarter
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starontopic star
Beiträge: 180

WinXP, SP2
D6 Enterprise
BeitragVerfasst: Sa 19.02.05 18:43 
Hi,
ich bin es doch noch einmal.
Die Funktion hat folgenden Syntax:

function MinimizeName(const Filename: TFileName; Canvas: TCanvas; MaxLen: Integer): TFileName;

Mit einer Labelkomponente funktioniert es super, aber wie ist es mit einer TEdit-Komponente?
Diese Komponente hat keinen TCanvas?

Cu
Crowbar

P.S.
Ich kann natürlich einen kleinen "Trick" durchführen, indem ich eine "unsichtbare" Labelkomponente (Visible:=false) nutzte und die Label.Caption auf Edit.Text übertrage. :roll:
Keldorn
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starontopic star
Beiträge: 2266
Erhaltene Danke: 4

Vista
D6 Prof, D 2005 Pro, D2007 Pro, DelphiXE2 Pro
BeitragVerfasst: Sa 19.02.05 18:54 
für ein Edit: wenn du keine speziellen Font-eigenschaften gesetzt hast, nimm das canvas der Form. Ansonsten erstell dir ein Hilfsbitmap, weiße die Fonteigenschaften zu und nutzt dann das canvas der bitmap.

_________________
Lükes Grundlage der Programmierung: Es wird nicht funktionieren.
(Murphy)
Crowbar Threadstarter
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starontopic star
Beiträge: 180

WinXP, SP2
D6 Enterprise
BeitragVerfasst: Sa 19.02.05 19:13 
Ja, mit der Form.Canvas klappt es wunderbar!
Warum umständlich, wenn es auch einfacher geht! :lol:

Vielen Dank, nochmal!

Cu
Crowbar

P.S.
Ich habe doch noch einen Link zu diesem Thema gefunden:
www.delphi-forum.de/...ghlight=minimizename