Hello Sergey,
I have created a runtime array of TRichViewEdit objects, each with its own TRVStyle but I cannot change the font.
I have copied the code from Editor 2. That works fine for design time objects but not for runtime objects.
Can you tell me how to do it?
Regards
Thomas Davenport
Changing fonts for runtime created TRichViewEdit
-
- Posts: 6
- Joined: Thu Jul 26, 2007 4:28 pm
- Location: Birmingham
-
- Posts: 6
- Joined: Thu Jul 26, 2007 4:28 pm
- Location: Birmingham
-
- Site Admin
- Posts: 17565
- Joined: Sat Aug 27, 2005 10:28 am
- Contact:
One note: initial values of TRichViewEdit properties are different for components placed on form at designtime and for components created at runtime.
For components placed on form at designtime, initial values are defined in the component editor (right click, "Settings").
For components created in code, initial values do not allow to load/save documents in RTF and RVF correctly, if you add new styles, like in Editor2 demo.
When you create documents at runtime, assign:
For components placed on form at designtime, initial values are defined in the component editor (right click, "Settings").
For components created in code, initial values do not allow to load/save documents in RTF and RVF correctly, if you add new styles, like in Editor2 demo.
When you create documents at runtime, assign:
Code: Select all
rv.RVFOptions := rv.RVFOptions+[rvfoSaveTextStyles, rvfoSaveParaStyles]; // you may wish to add other options
rv.RVFTextStylesReadMode := rvf_sInsertMerge;
rv.RVFParaStylesReadMode := rvf_sInsertMerge;
rv.RTFReadProperties.TextStyleMode := rvrsAddIfNeeded;
rv.RTFReadProperties.ParaStyleMode := rvrsAddIfNeeded;