Autor Beitrag
youpy
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starontopic star
Beiträge: 32

win XP
7 Enterprise
BeitragVerfasst: Do 18.03.04 19:01 
lol ich hab mal wieder ne geile frage.. wie kann ich in einem label zeilenumbrüche manuell einfügen ich habs schon mit \n versucht.. hat aber nich richtig geklappt.. plz einfahcmal n codebeispiel

_________________
shice wtj
Benedikt
Ehemaliges Mitglied
Erhaltene Danke: 1



BeitragVerfasst: Do 18.03.04 19:04 
Hi,

so gehts:

ausblenden Delphi-Quelltext
1:
label1.caption:='test'+#13#10+'test';					

Also: #13#10, die Zeichen für einen Zeilenumbruch unter Windows.
youpy Threadstarter
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starontopic star
Beiträge: 32

win XP
7 Enterprise
BeitragVerfasst: Do 18.03.04 19:25 
bei ir zeigt er da leider nur || an tztz
noch ne zusätzliche frage... wo finde ich bei textfeldern ne eigenschaft famit das teil mehrzeilig wird?

_________________
shice wtj
MSCH
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starhalf ontopic star
Beiträge: 1448
Erhaltene Danke: 3

W7 64
XE2, SQL, DevExpress, DevArt, Oracle, SQLServer
BeitragVerfasst: Do 18.03.04 19:28 
youpy hat folgendes geschrieben:
bei ir zeigt er da leider nur || an tztz
noch ne zusätzliche frage... wo finde ich bei textfeldern ne eigenschaft famit das teil mehrzeilig wird?


überhaupt nicht, was du braucht ist ein MEMO-Objekt.
grez
msch

_________________
ist das politisch, wenn ich linksdrehenden Joghurt haben möchte?
galagher
ontopic starontopic starontopic starontopic starontopic starontopic starofftopic starofftopic star
Beiträge: 2562
Erhaltene Danke: 46

Windows 10 Home
Delphi 10.1 Starter, Lazarus 2.0.6
BeitragVerfasst: Do 18.03.04 20:05 
youpy hat folgendes geschrieben:
lol ich hab mal wieder ne geile frage.. wie kann ich in einem label zeilenumbrüche manuell einfügen


Versuch's so (den Tipp hab' ich selber vom Forum - dafür nochmal danke!):

ausblenden Delphi-Quelltext
1:
2:
3:
4:
5:
6:
7:
8:
9:
10:
11:
12:
13:
14:
15:
function TForm1.LabelCaption(ALabel: TLabel; CRLF: Boolean; Text: String): String;
var
  List: TStringList;
begin
 List := TStringList.Create;
 if CRLF then Result := #13#10+Text+List.Text  //Wenn CRLF True ist, Zeilenumbruch, sonst nicht
 else
              Result := Text+List.Text;
 List.Free;
end;

procedure TForm1.FormClick(Sender: TObject);
begin
 Label1.Caption := Label1.Caption+LabelCaption(Label1,True,'Neuer Text');
end;

_________________
gedunstig war's - und fahle wornen zerschellten karsig im gestrock. oh graus, es gloomt der jabberwock - und die graisligen gulpen nurmen!
MartinPb
ontopic starontopic starontopic starontopic starontopic starontopic starhalf ontopic starofftopic star
Beiträge: 698



BeitragVerfasst: Do 18.03.04 20:41 
@ youpy

Zwei Fragen: Mit welcher Programmiersprache Programmierst du und für welches Betriebssystem? Das /n sieht mir nicht nach Delphi- und Windowskenntnis aus, sondern erinnert mich an andere Systeme. Weiterhin bewirkt das #13#10 unter Windows den Zeilenumbruch. Aber eben nur unter Windows.

_________________
Gruß
Martin
Luckie
Ehemaliges Mitglied
Erhaltene Danke: 1



BeitragVerfasst: Fr 19.03.04 00:26 
youpy hat folgendes geschrieben:
bei ir zeigt er da leider nur || an tztz
noch ne zusätzliche frage... wo finde ich bei textfeldern ne eigenschaft famit das teil mehrzeilig wird?

Geht bei mir ohne WordWrap vom Label auf True zu stellen, nur Autosize muss True sein.[/delphi]
youpy Threadstarter
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starontopic star
Beiträge: 32

win XP
7 Enterprise
BeitragVerfasst: Fr 19.03.04 14:51 
io t h x
hat sich erledigt.... hab gezt einfach memo henommen... das /n hmmm weiß nicht aus welcher programmiersprache ich das hab... aber es gibt viele die das benutzen

_________________
shice wtj
StefanH
ontopic starontopic starontopic starontopic starontopic starontopic starhalf ontopic starofftopic star
Beiträge: 1144

Win XP
D5 Standard, D7 Pers, D2005 Pers
BeitragVerfasst: Fr 19.03.04 15:11 
/n ist z.B JavaScript... 8)

_________________
"Als es noch keine Computer gab, war das Programmieren noch relativ einfach."(Edsger W. Dijkstra)
"Ich bin nicht von Sinnen, sondern ich rede wahre und vernünftige Worte." (Paulus)
Benedikt
Ehemaliges Mitglied
Erhaltene Danke: 1



BeitragVerfasst: Fr 19.03.04 15:53 
Nur zur Info:
Es ist \n, nicht /n 8)
StefanH
ontopic starontopic starontopic starontopic starontopic starontopic starhalf ontopic starofftopic star
Beiträge: 1144

Win XP
D5 Standard, D7 Pers, D2005 Pers
BeitragVerfasst: So 21.03.04 15:06 
:oops: :roll:

_________________
"Als es noch keine Computer gab, war das Programmieren noch relativ einfach."(Edsger W. Dijkstra)
"Ich bin nicht von Sinnen, sondern ich rede wahre und vernünftige Worte." (Paulus)