Autor Beitrag
Leuchtturm
ontopic starontopic starontopic starontopic starontopic starontopic starhalf ontopic starofftopic star
Beiträge: 1087

Win Vista, Knoppix, Ubuntu
Delphi 7 Pe, Turbo Delphi, C#(VS 2005 Express), (X)HTML + CSS, bald Assembler
BeitragVerfasst: Mo 29.05.06 14:54 
hi,
weiß jemand wie man den Text in einem Memo fett machen kann?
Leuchtturm

_________________
Ich bin dafür verantwortlich was ich sage - nicht dafür was du verstehst.


Zuletzt bearbeitet von Leuchtturm am Mo 29.05.06 15:27, insgesamt 1-mal bearbeitet
Gausi
ontopic starontopic starontopic starontopic starontopic starontopic starofftopic starofftopic star
Beiträge: 8554
Erhaltene Danke: 481

Windows 7, Windows 10
D7 PE, Delphi XE3 Prof, Delphi 10.3 CE
BeitragVerfasst: Mo 29.05.06 14:56 
Schau dir mal die Eigenschaft Fonts, und da speziell Style an. Damit kannst du die Schrift verändern.

Falls du nur einzelne Passagen fett haben willst: Das geht mit dem Memo nicht - dafür wäre das Richedit besser geeignet.

_________________
We are, we were and will not be.
Kroko
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starhalf ontopic star
Beiträge: 1284

W98 W2k WXP
Turbo D
BeitragVerfasst: Mo 29.05.06 14:56 
Im Objektinspektor Memo -> Font -> Style -> fsBold -> True


//EDIT: Mist wieder zu laaaaahhhhhhmmm :wink:

_________________
Die F1-Taste steht nicht unter Naturschutz und darf somit regelmäßig und oft benutzt werden! oder Wer lesen kann, ist klar im Vorteil!
Leuchtturm Threadstarter
ontopic starontopic starontopic starontopic starontopic starontopic starhalf ontopic starofftopic star
Beiträge: 1087

Win Vista, Knoppix, Ubuntu
Delphi 7 Pe, Turbo Delphi, C#(VS 2005 Express), (X)HTML + CSS, bald Assembler
BeitragVerfasst: Mo 29.05.06 14:59 
Danke erstmal.
Ich habe mich wohl etwas undeutlich ausgedrückt.
Ich wollte über einen ButtonClick das Memo oder RichEdit fett machen

_________________
Ich bin dafür verantwortlich was ich sage - nicht dafür was du verstehst.
Gausi
ontopic starontopic starontopic starontopic starontopic starontopic starofftopic starofftopic star
Beiträge: 8554
Erhaltene Danke: 481

Windows 7, Windows 10
D7 PE, Delphi XE3 Prof, Delphi 10.3 CE
BeitragVerfasst: Mo 29.05.06 15:00 
ausblenden Delphi-Quelltext
1:
Memo1.Font.Style := [fsbold];					

und wieder normal:
ausblenden Delphi-Quelltext
1:
Memo1.Font.Style := [];					

_________________
We are, we were and will not be.
Leuchtturm Threadstarter
ontopic starontopic starontopic starontopic starontopic starontopic starhalf ontopic starofftopic star
Beiträge: 1087

Win Vista, Knoppix, Ubuntu
Delphi 7 Pe, Turbo Delphi, C#(VS 2005 Express), (X)HTML + CSS, bald Assembler
BeitragVerfasst: Mo 29.05.06 15:02 
Danke

_________________
Ich bin dafür verantwortlich was ich sage - nicht dafür was du verstehst.
Leuchtturm Threadstarter
ontopic starontopic starontopic starontopic starontopic starontopic starhalf ontopic starofftopic star
Beiträge: 1087

Win Vista, Knoppix, Ubuntu
Delphi 7 Pe, Turbo Delphi, C#(VS 2005 Express), (X)HTML + CSS, bald Assembler
BeitragVerfasst: Mo 29.05.06 15:14 
Wie kann ich dass machen dass man nur den markierten Teil fett macht

_________________
Ich bin dafür verantwortlich was ich sage - nicht dafür was du verstehst.
Kroko
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starhalf ontopic star
Beiträge: 1284

W98 W2k WXP
Turbo D
BeitragVerfasst: Mo 29.05.06 15:17 
(a) lesen (siehe oben)
(b) gar nicht mit TMemo

_________________
Die F1-Taste steht nicht unter Naturschutz und darf somit regelmäßig und oft benutzt werden! oder Wer lesen kann, ist klar im Vorteil!
Leuchtturm Threadstarter
ontopic starontopic starontopic starontopic starontopic starontopic starhalf ontopic starofftopic star
Beiträge: 1087

Win Vista, Knoppix, Ubuntu
Delphi 7 Pe, Turbo Delphi, C#(VS 2005 Express), (X)HTML + CSS, bald Assembler
BeitragVerfasst: Mo 29.05.06 15:19 
Ich meinte im RichEdit und dazu steht oben nichts

_________________
Ich bin dafür verantwortlich was ich sage - nicht dafür was du verstehst.
Kroko
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starhalf ontopic star
Beiträge: 1284

W98 W2k WXP
Turbo D
BeitragVerfasst: Mo 29.05.06 15:21 
user profile iconLeuchtturm hat folgendes geschrieben:
Ich meinte im RichEdit und dazu steht oben nichts

(a) im Titel steht aber TMemo
(b) die Suche hier sollte etwas bringen, die Frage kommt bestimmt 1x pro Woche! :wink:

_________________
Die F1-Taste steht nicht unter Naturschutz und darf somit regelmäßig und oft benutzt werden! oder Wer lesen kann, ist klar im Vorteil!
Leuchtturm Threadstarter
ontopic starontopic starontopic starontopic starontopic starontopic starhalf ontopic starofftopic star
Beiträge: 1087

Win Vista, Knoppix, Ubuntu
Delphi 7 Pe, Turbo Delphi, C#(VS 2005 Express), (X)HTML + CSS, bald Assembler
BeitragVerfasst: Mo 29.05.06 15:28 
Unter was muss ich suchen? :?:
Ich finde nichts :!:

_________________
Ich bin dafür verantwortlich was ich sage - nicht dafür was du verstehst.
DelphiAnfänger
ontopic starontopic starontopic starontopic starontopic starhalf ontopic starofftopic starofftopic star
Beiträge: 112

Win XP, Firefox 2.0, IE6
Delphi 5 Prof., Delphi 2005 PE
BeitragVerfasst: Mo 29.05.06 15:31 
Leuchtturm Threadstarter
ontopic starontopic starontopic starontopic starontopic starontopic starhalf ontopic starofftopic star
Beiträge: 1087

Win Vista, Knoppix, Ubuntu
Delphi 7 Pe, Turbo Delphi, C#(VS 2005 Express), (X)HTML + CSS, bald Assembler
BeitragVerfasst: Mo 29.05.06 15:54 
Das hab ich jetzt gefunden und bisschen dranrumprobiert:
ausblenden Delphi-Quelltext
1:
2:
3:
4:
5:
6:
7:
  var Start, Laenge: Integer;

  Start := Pos(RichEdit1.Lines[RichEdit1.Lines.Count], RichEdit1.Text);
  Laenge := Length(Text);
  RichEdit1.SelStart := Start;
  RichEdit1.SelLength := Laenge;
  RichEdit1.SelAttributes.Style := [fsBold];

funktioniert aber nicht.
Es werden nicht die markierten Teile formatiert.
Mit dem Quelltext werden immer bloß:
Zitat:
RichEdit
formatiert

_________________
Ich bin dafür verantwortlich was ich sage - nicht dafür was du verstehst.
jasocul
ontopic starontopic starontopic starontopic starontopic starontopic starhalf ontopic starofftopic star
Beiträge: 6395
Erhaltene Danke: 149

Windows 7 + Windows 10
Sydney Prof + CE
BeitragVerfasst: Mo 29.05.06 15:56 
Probier mal:
ausblenden Delphi-Quelltext
1:
2:
3:
4:
5:
6:
7:
  var Start, Laenge: Integer;

  Start := Pos(RichEdit1.Lines[RichEdit1.Lines.Count], RichEdit1.Text);
  Laenge := Length(RichEdit1.Text); // Hier korrigiert !
  RichEdit1.SelStart := Start;
  RichEdit1.SelLength := Laenge;
  RichEdit1.SelAttributes.Style := [fsBold];
Leuchtturm Threadstarter
ontopic starontopic starontopic starontopic starontopic starontopic starhalf ontopic starofftopic star
Beiträge: 1087

Win Vista, Knoppix, Ubuntu
Delphi 7 Pe, Turbo Delphi, C#(VS 2005 Express), (X)HTML + CSS, bald Assembler
BeitragVerfasst: Mo 29.05.06 15:59 
Da wird alles fett, ich will aber nur das markierte fett machen.
Ich bin Anfänger und verstehe das nicht

_________________
Ich bin dafür verantwortlich was ich sage - nicht dafür was du verstehst.
jasocul
ontopic starontopic starontopic starontopic starontopic starontopic starhalf ontopic starofftopic star
Beiträge: 6395
Erhaltene Danke: 149

Windows 7 + Windows 10
Sydney Prof + CE
BeitragVerfasst: Mo 29.05.06 16:02 
Da du schon was selektiert hast, darfst du die entsprechenden Eigenschaften (SelStart und SelLength) nicht verändern.
ausblenden Delphi-Quelltext
1:
RichEdit1.SelAttributes.Style := [fsBold];					

Das sollte dann theoretisch genügen.
Leuchtturm Threadstarter
ontopic starontopic starontopic starontopic starontopic starontopic starhalf ontopic starofftopic star
Beiträge: 1087

Win Vista, Knoppix, Ubuntu
Delphi 7 Pe, Turbo Delphi, C#(VS 2005 Express), (X)HTML + CSS, bald Assembler
BeitragVerfasst: Mo 29.05.06 16:02 
Danke ,
dass hab ich in der Hilfe gefunden:
ausblenden Delphi-Quelltext
1:
RichEdit1.SelAttributes.Style := RichEdit1.SelAttributes.Style + [fsBold];					

und es funkrioniert
deins funktioniert aber auch

_________________
Ich bin dafür verantwortlich was ich sage - nicht dafür was du verstehst.
jasocul
ontopic starontopic starontopic starontopic starontopic starontopic starhalf ontopic starofftopic star
Beiträge: 6395
Erhaltene Danke: 149

Windows 7 + Windows 10
Sydney Prof + CE
BeitragVerfasst: Mo 29.05.06 16:07 
Das aus der Hilfe ist aber besser, wenn du mit verschiedenen Formatierungen arbeitest:
fsItalic + fsBold -> Kursiv und Fett.
Leuchtturm Threadstarter
ontopic starontopic starontopic starontopic starontopic starontopic starhalf ontopic starofftopic star
Beiträge: 1087

Win Vista, Knoppix, Ubuntu
Delphi 7 Pe, Turbo Delphi, C#(VS 2005 Express), (X)HTML + CSS, bald Assembler
BeitragVerfasst: Mo 29.05.06 16:16 
Ja ich mache es jetzt so wie du es Vorgeschlagen hast.
(Die andere Variante ist zu lange :mrgreen:

_________________
Ich bin dafür verantwortlich was ich sage - nicht dafür was du verstehst.