Hallo,
ich hab folgendes Problem:
Ich hab mir zum speichern von Fonts zwei Objekte vom Typ TFont gemacht
Delphi-Quelltext
1: 2:
| Font1 := TFont.Create; Font2 := TFont.Create; |
Und zwei Funktion zum speichern von Fontstyles:
Delphi-Quelltext
1: 2: 3: 4: 5: 6: 7: 8: 9: 10: 11: 12: 13: 14: 15: 16: 17: 18: 19: 20: 21: 22: 23: 24: 25: 26: 27: 28:
| function LoadFontStyle(AString: String):TFontStyles; begin if AString[1] = '1' then result := result + [fsStrikeout]; if AString[2] = '1' then result := result + [fsUnderline]; if AString[3] = '1' then result := result + [fsItalic]; if AString[4] = '1' then result := result + [fsBold]; end;
function SaveFontStyle(AStyle: TFontStyle): String; begin if AStyle = AStyle + [fsStrikeOut] then result := '1' else result := '0'; if AStyle = AStyle + [fsUnderline] then result := result + '1' else result := result + '0'; if AStyle = AStyle + [fsItalic] then result := result + '1' else result := result + '0'; if AStyle = AStyle + [fsBold] then result := result + '1' else result := result + '0'; end; |
nun lad ich in Font1 einen String mit 0000 und in Font2 einen mit 0010.
Wenn ich nun diesen Code ausführe:
Delphi-Quelltext
1: 2: 3:
| Fontdialog1.Font.Assign(Font1); if FontDialog1.Execute then Font1.Assign(Fontdialog1.Font); |
dann zeigt er mir immer das Underline gesetzt ist obwohl ichs im String ja nicht gesetzt hab.
das gleiche passiert mit Fontdialog2 und Font2.
warum funktioniert der Code nicht???
lg elundril