Autor Beitrag
NeMeZ
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starontopic star
Beiträge: 25

Win7
Delphi10
BeitragVerfasst: Do 05.06.08 18:26 
Hallo Leute!!!

Habe Delphi7....

Wie kann ich im Memo mit hilfe FontDialog Schriftart und Schriftgrad ändern?

Danke.
Clemens L.
ontopic starontopic starontopic starontopic starontopic starofftopic starofftopic starofftopic star
Beiträge: 158

Win Xp SP3
D6 Enterprise, Turbo Delphi Explorer
BeitragVerfasst: Do 05.06.08 18:28 
ausblenden Delphi-Quelltext
1:
2:
If FontDialog1.Execute then
  Memo1.Font := FontDialog1.Font;


Ungetestet ... :P
GericasS
ontopic starontopic starontopic starontopic starontopic starhalf ontopic starofftopic starofftopic star
Beiträge: 540

Windows Vista Home Premium
D2010, VisualStudio2008
BeitragVerfasst: Do 05.06.08 18:34 
user profile iconClemens L. hat folgendes geschrieben:
ausblenden Delphi-Quelltext
1:
2:
If FontDialog1.Execute then
  Memo1.Font := FontDialog1.Font;


Ungetestet ... :P


getestet :zustimm: und geht =)

_________________
Alexander N.
Neue Bewaffnung Amilo xi2428 T9300
Clemens L.
ontopic starontopic starontopic starontopic starontopic starofftopic starofftopic starofftopic star
Beiträge: 158

Win Xp SP3
D6 Enterprise, Turbo Delphi Explorer
BeitragVerfasst: Do 05.06.08 18:59 
Hatte ich nicht anders erwartet :D
NeMeZ Threadstarter
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starontopic star
Beiträge: 25

Win7
Delphi10
BeitragVerfasst: Fr 06.06.08 14:10 
Danke, geholfen...
Yogu
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starhalf ontopic star
Beiträge: 2598
Erhaltene Danke: 156

Ubuntu 13.04, Win 7
C# (VS 2013)
BeitragVerfasst: Fr 06.06.08 14:23 
Hallo,

was du noch ganz oben einfügen solltest, ist diese Zeile:

ausblenden Delphi-Quelltext
1:
FontDialog1.Font := Memo1.Font;					

Sonst kann es passieren, dass über ein Aufrufen und sofortiges OK-Klicken die Schriftart geändert wurde, obwohl gar nichts eingegeben wurde.

Grüße,
Yogu
Clemens L.
ontopic starontopic starontopic starontopic starontopic starofftopic starofftopic starofftopic star
Beiträge: 158

Win Xp SP3
D6 Enterprise, Turbo Delphi Explorer
BeitragVerfasst: Fr 06.06.08 14:52 
Das könnte man noch ins FormCreate einfügen, danach brauch man das nichtmehr!
Yogu
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starhalf ontopic star
Beiträge: 2598
Erhaltene Danke: 156

Ubuntu 13.04, Win 7
C# (VS 2013)
BeitragVerfasst: Fr 06.06.08 16:32 
user profile iconClemens L. hat folgendes geschrieben:
Das könnte man noch ins FormCreate einfügen, danach brauch man das nichtmehr!

Es ist auf jeden Fall sauberer, es vor jedem Aufrufen zu machen. Ich weiß nicht, ob bei Abbrechen die alte Font wieder gesetzt wird, aber wenn nicht, würde es hier asynchron werden. Und vielleicht willst du den Dialog auch mal für mehrere Felder nehmen...
Clemens L.
ontopic starontopic starontopic starontopic starontopic starofftopic starofftopic starofftopic star
Beiträge: 158

Win Xp SP3
D6 Enterprise, Turbo Delphi Explorer
BeitragVerfasst: Fr 06.06.08 16:46 
In dem Falle müsste man natürlich immer anpassen, aber normal bleibt die Schrift ja als Property gespeichert.
NeMeZ Threadstarter
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starontopic star
Beiträge: 25

Win7
Delphi10
BeitragVerfasst: So 08.06.08 14:11 
könnt ihr mir sagen wo ist hier falsch? :

ausblenden Quelltext
1:
2:
3:
4:
5:
6:
procedure TForm1.N7Click(Sender: TObject);
begin
 if finddialog1.Execute then
 finddialog1.FindText(memo1.Lines.Text);

end;


ich bekomme immer wider fehlermeldung: "Missing operator or semicolon"
Yogu
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starhalf ontopic star
Beiträge: 2598
Erhaltene Danke: 156

Ubuntu 13.04, Win 7
C# (VS 2013)
BeitragVerfasst: So 08.06.08 14:27 
user profile iconNeMeZ, ich möchte nicht unhöflich erscheinen, aber das ist doch nicht dein Ernst, oder? Was hat denn eine Suche mit der Änderung der Schriftart zu tun? Erstelle doch bitte ein neues Thema.
NeMeZ Threadstarter
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starontopic star
Beiträge: 25

Win7
Delphi10
BeitragVerfasst: So 08.06.08 14:29 
OK. :)