Am running into a problem on how to store the TFont properties of a memo (or any component at that) to a database

Please help.

Search for ReadComponent/WriteComponent. These are the functions also used to store them in the .dfm. You can use them to store them in a stream or string, and write that to the database.

Thanks for the prompt reply @pritaeas,

To access the properties and having them in string ended up using the code below;

MyFont := EditBox.Font.Name;
MyStyle := IntToStr(Byte(EditBox.Font.Style)); 
MyColor := IntToStr(Byte(EditBox.Font.Color));
MySize := EditBox.Font.Size;

With this it was easy to save to a database and apply the reverse when reading from the database

EditBox.Font.Name := FieldByName('MyFont').asstring;
EditBox.Font.Style := TFontStyles(Byte(FieldByName('MyStyle').asinteger));
EditBox.Font.Color := FieldByName('MyColor').AsInteger;
EditBox.Font.Size := FieldByName('MySize').asinteger;

Edited 4 Years Ago by KE50: Name

This question has already been answered. Start a new discussion instead.