Цитата:
Сообщение от lmikle
Код:
Label.Font.Style := Label.Font.Style + [fsUnderline]
не?
|
Специально кодом все сделал:
Код:
procedure TForm1.Button1Click(Sender: TObject);
const
Str = 'die U-Bahn-Station';
MonoFontName = 'Courier';
MonoFontSize = 18;
MonoFontSpace = 4;
var
L : TLabel;
X, Y, D : Integer;
I : Integer;
tmpFontName : String;
tmpFontSize : Integer;
begin
Y := Button1.Top + Button1.Height + 8;
X := Button1.Left;
tmpFontName := Self.Font.Name;
tmpFontSize := Self.Font.Size;
Self.Font.Name := MonoFontName;
Self.Font.Size := MonoFontSize;
D := Self.Canvas.TextWidth('W') + MonoFontSpace;
Self.Font.Name := tmpFontName;
Self.Font.Size := tmpFontSize;
For I := 1 To Length(Str) Do
Begin
L := TLabel.Create(Self);
L.Font.Name := MonoFontName;
L.Font.Size := MonoFontSize;
If Str[i] <> ' ' Then L.Font.Style := L.Font.Style + [fsUnderline];
L.Left := X;
L.Top := Y;
L.Caption := Str[i];
X := X + D;
L.Parent := Self;
End;
end;
Только надо шрифт правильный подобрать - походу нужен моноширинный. У меня почемуто Courier New отказался подчеркиваться.