AGB  ·  Datenschutz  ·  Impressum  







Anmelden
Nützliche Links
Registrieren
Thema durchsuchen
Ansicht
Themen-Optionen

Label and DT_END_ELLIPSIS

Ein Thema von sdean · begonnen am 29. Apr 2010
Antwort Antwort
sdean

Registriert seit: 5. Dez 2009
64 Beiträge
 
#1

Label and DT_END_ELLIPSIS

  Alt 29. Apr 2010, 13:09
Hi i use the following code to show the '...' or ellipsis when the label's caption doesn't fil its width :

Delphi-Quellcode:
procedure TForm1.Button1Click(Sender: TObject);
var
S,M: string;
  R: TRect;
begin
  M:='or adjust label width';
  S := 'this is way too long to fit into a label - trim it down';
  UniqueString(S);
  R := label1.Canvas.ClipRect;
  label1.Canvas.Font := label1.Font;
  DrawText(label1.Canvas.Handle, PChar(S), Length(S), R,
    DT_END_ELLIPSIS or DT_MODIFYSTRING or DT_NOPREFIX);
  label1.Caption := S;
 end;
Label's width :201
Label's autosize : false .

the result will be : this is way too long to fit into a label - trim ...

But what i want is to add the M value 'or adjust label width ' after the ellipsis so the result will be :
this is way too long to fit into a label - trim ...or adjust label width

please how could i do this last one .
  Mit Zitat antworten Zitat
Antwort Antwort


Forumregeln

Es ist dir nicht erlaubt, neue Themen zu verfassen.
Es ist dir nicht erlaubt, auf Beiträge zu antworten.
Es ist dir nicht erlaubt, Anhänge hochzuladen.
Es ist dir nicht erlaubt, deine Beiträge zu bearbeiten.

BB-Code ist an.
Smileys sind an.
[IMG] Code ist an.
HTML-Code ist aus.
Trackbacks are an
Pingbacks are an
Refbacks are aus

Gehe zu:

Impressum · AGB · Datenschutz · Nach oben
Alle Zeitangaben in WEZ +1. Es ist jetzt 04:19 Uhr.
Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
LinkBacks Enabled by vBSEO © 2011, Crawlability, Inc.
Delphi-PRAXiS (c) 2002 - 2023 by Daniel R. Wolf, 2024 by Thomas Breitkreuz