Как вывести текст с красивым обрезанием если не помещается?
Falk0ner, вс, 06/07/2008 - 15:34.
Используй вызов DrawTextEx, установив в параметре dwDTFormat значение DT_PATH_ELLIPSIS.
procedure TForm1.FormPaint(Sender: TObject);
var
r: TRect;
begin
r := Rect(20, 20, 110, 70);
// DT_PATH_ELLIPSIS or DT_WORD_ELLIPSIS or DT_END_ELLIPSIS
DrawTextEx(Form1.Canvas.Handle, 'Delphi World - это круто!!!',
25, r, DT_WORD_ELLIPSIS, nil);
end;
var
r: TRect;
begin
r := Rect(20, 20, 110, 70);
// DT_PATH_ELLIPSIS or DT_WORD_ELLIPSIS or DT_END_ELLIPSIS
DrawTextEx(Form1.Canvas.Handle, 'Delphi World - это круто!!!',
25, r, DT_WORD_ELLIPSIS, nil);
end;
Взято с http://delphiworld.narod.ru
Отправить комментарий