Autor Beitrag
bruce185
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starontopic star
Beiträge: 283

winXP
D7 Ent
BeitragVerfasst: Mo 02.07.07 19:43 
Hallo,
gibt es in Delphi 7 einen Label Komponent der über mehrere zeilen verfügt?

Danke euch schonmal.

MfG
mkinzler
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starofftopic star
Beiträge: 4106
Erhaltene Danke: 13


Delphi 2010 Pro; Delphi.Prism 2011 pro
BeitragVerfasst: Mo 02.07.07 19:49 
Jein, nimm ein TMemo oder implementiere OwnerDraw

_________________
Markus Kinzler.
bruce185 Threadstarter
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starontopic star
Beiträge: 283

winXP
D7 Ent
BeitragVerfasst: Mo 02.07.07 19:57 
Danke.
Ich kann bei meinem Programm keinen TMemo nehmen, da ich sowas wie Quiz machen möchte wo man dann die CheckBoxen anklicken muss und die Antworten meistens mehr wie eine zeile haben, deshalb brauche ich einen Label der über mehrere zeilen verfügt.
Es gibt doch bestimmt welche Komponenten dafür, oder?

MfG
mkinzler
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starofftopic star
Beiträge: 4106
Erhaltene Danke: 13


Delphi 2010 Pro; Delphi.Prism 2011 pro
BeitragVerfasst: Mo 02.07.07 20:00 
Imho ist ein Memo ein mehrzeiliges Label. Oder halt selber Zeichnen

_________________
Markus Kinzler.
Timosch
ontopic starontopic starontopic starontopic starontopic starofftopic starofftopic starofftopic star
Beiträge: 1314

Debian Squeeze, Win 7 Prof.
D7 Pers
BeitragVerfasst: Mo 02.07.07 20:02 
user profile iconmkinzler hat folgendes geschrieben:
Imho ist ein Memo ein mehrzeiliges Label. Oder halt selber Zeichnen

Ich würde sagen, ein mehrzeiliges Edit.

_________________
If liberty means anything at all, it means the right to tell people what they do not want to hear. - George Orwell
bruce185 Threadstarter
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starontopic star
Beiträge: 283

winXP
D7 Ent
BeitragVerfasst: Mo 02.07.07 20:22 
Also TMemo ist kein Label Komponent sondern ein Edit Komponent.
Ich brauche dringend einen Label komponent der auch über mehrere zeilen verfügt, ich hatte sowas früher mal aber nach formatierung der Festplatte ist alles wieder gelöscht...
Dunkel
ontopic starontopic starontopic starontopic starontopic starontopic starofftopic starofftopic star
Beiträge: 682

Mac OS X Snow Leopard
Xcode 3.1
BeitragVerfasst: Mo 02.07.07 20:25 
Probier es mal so:
ausblenden Delphi-Quelltext
1:
  Label1.Caption:= 'Zeile1' + #13#10 + 'Zeile2';					

_________________
Ich streite einsam mich mit dieser Oberflächenwelt
Gutes sei ein löblich Brot von dem ich zehre - bis zum Tod [Das Ich - Im Ich]
hathor
Ehemaliges Mitglied
Erhaltene Danke: 1



BeitragVerfasst: Mo 02.07.07 21:51 
Nimm Buttons statt Labels:

ausblenden Delphi-Quelltext
1:
2:
3:
4:
5:
6:
7:
8:
9:
10:
11:
12:
13:
14:
15:
16:
17:
18:
19:
function SetMultiLineCaption(const p_Button : TButton;const p_sCaption : String;const p_fAutoAdjust : Boolean = false) : Boolean;
begin
  Result := false;
  if SetWindowLong(p_Button.Handle, GWL_STYLE, GetWindowLong(p_Button.Handle, GWL_STYLE) or BS_MULTILINE)> 0 then
  begin
    p_Button.Caption := p_sCaption;
    Result := true;
  end;
end;

function TextAlignCaption(const p_Button : TButton; const p_sCaption : String;const p_fAutoAdjust : Boolean = false) : Boolean;
begin
  Result := false;   //  BS_LEFT BS_RIGHT oder BS_CENTER
  if SetWindowLong(p_Button.Handle, GWL_STYLE, GetWindowLong(p_Button.Handle, GWL_STYLE) or BS_LEFT)> 0 then
  begin
    p_Button.Caption := p_sCaption;
    Result := true;
  end;
end;


Zuletzt bearbeitet von hathor am Mo 02.07.07 22:25, insgesamt 1-mal bearbeitet
aim65
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starhalf ontopic star
Beiträge: 312

Win 9x, Win XP
Delphi 3pro, 7PE
BeitragVerfasst: Mo 02.07.07 22:14 
Hallo,

Warum denn so kompliziert?
Ein mehrzeiliges Label ist doch eingebaut --> "WordWrap := true". Guck mal auf die letzte Zeile im OI. :wink:
hathor
Ehemaliges Mitglied
Erhaltene Danke: 1



BeitragVerfasst: Mo 02.07.07 22:29 
Ist zwar nicht die letzte Zeile, aber man findet es unter MISCELLANEOUS.
aim65
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starhalf ontopic star
Beiträge: 312

Win 9x, Win XP
Delphi 3pro, 7PE
BeitragVerfasst: Mo 02.07.07 22:46 
Hallo Hathor,
weiß nicht, welches Delphi Du benutzt, aber bei D3 und D7PE gibt's kein Michelangelo - da ist's die letzte Zeile im OI.
Horst
hathor
Ehemaliges Mitglied
Erhaltene Danke: 1



BeitragVerfasst: Mo 02.07.07 23:09 
Borland® Developer Studio for Microsoft® Windows™ Version 10.0.2151.25345
Coder
ontopic starontopic starontopic starontopic starontopic starontopic starofftopic starofftopic star
Beiträge: 1383
Erhaltene Danke: 1

WinXP
D2005 PE
BeitragVerfasst: Di 03.07.07 00:08 
user profile iconaim65 hat folgendes geschrieben:
Hallo Hathor,
weiß nicht, welches Delphi Du benutzt, aber bei D3 und D7PE gibt's kein Michelangelo - da ist's die letzte Zeile im OI.
Horst

Ab Delphi 8 (glaub ich) lassen sich die Einträge im OI nach Wahl in Kategorien oder alphabetisch anordnen.
matze
ontopic starontopic starontopic starontopic starontopic starontopic starhalf ontopic starofftopic star
Beiträge: 4613
Erhaltene Danke: 24

XP home, prof
Delphi 2009 Prof,
BeitragVerfasst: Di 03.07.07 07:08 
Also das Rätselraten ist ja schrecklich. Von Memos über Buttons. :shock:
Die Lösungen wurden bereits gepostet!

Lösung 1:
user profile iconDunkel hat folgendes geschrieben:
Probier es mal so:
ausblenden Delphi-Quelltext
1:
  Label1.Caption:= 'Zeile1' + #13#10 + 'Zeile2';					


Oder Lösung 2:
user profile iconaim65 hat folgendes geschrieben:

Ein mehrzeiliges Label ist doch eingebaut --> "WordWrap := true".

_________________
In the beginning was the word.
And the word was content-type: text/plain.