Autor Beitrag
JRegier
ontopic starontopic starontopic starontopic starontopic starhalf ontopic starofftopic starofftopic star
Beiträge: 1268

Win XP Home, Prof, 2003 Server
D6 Enterprise
BeitragVerfasst: So 24.07.05 10:27 
Hi, ich habe da jetzt mit

ausblenden Delphi-Quelltext
1:
2:
3:
4:
5:
6:
7:
8:
9:
10:
   if(BoldBtn.Down) and (ItalicBtn.Down)then
   FontPanel.Font.Style := [fsBold,fsItalic]
   else
   if(BoldBtn.Down)then
   FontPanel.Font.Style := [fsBold]
   else
   if(ItalicBtn.Down)then
   FontPanel.Font.Style := [fsItalic]
   else
   FontPanel.Font.Style := [];


die FontStyles bestimmt aber jetzt wollte ich auch noch Underline und StrikeOut verwenden das wird ja dann
ein reisen Code! Kann man das kürzer fassen?
Also z.B.

ausblenden Delphi-Quelltext
1:
2:
3:
4:
if BoldBtn.Down then
Font.Style .. Add(fsBold) // was weiß ich
if ItalicBtn.Down then
Font.Style .. Add(fsItalic) // usw..


wie läßt sich das machen?

// EDIT

OK ich habs rausgefunden

ausblenden Delphi-Quelltext
1:
2:
3:
4:
5:
6:
7:
   with FontPanel.Font do
   begin
   Style := [];
   if(BoldBtn.Down) then Style := Style + [fsBold];
   if(ItalicBtn.Down) then Style := Style + [fsItalic];
   if(UnderLineBtn.Down) then Style := Style + [fsUnderline];
   end;


Moderiert von user profile iconChristian S.: Delphi-Tags hinzugefügt.
Christian S.
ontopic starontopic starontopic starontopic starontopic starontopic starhalf ontopic starofftopic star
Beiträge: 20451
Erhaltene Danke: 2264

Win 10
C# (VS 2019)
BeitragVerfasst: So 24.07.05 10:46 
Titel: Re: Ein set of ansammeln? if BoldBtn.Down if ItalicBtn.Down.
user profile iconJRegier hat folgendes geschrieben:
OK ich habs rausgefunden
Dann markiere den Thread doch bitte als gelöst, der Hinweis dazu ist doch wirklich groß genug :roll:

_________________
Zwei Worte werden Dir im Leben viele Türen öffnen - "ziehen" und "drücken".