Clear RichViewEdit completely
Posted: Wed Aug 10, 2011 6:11 am
Just want to know how should I clean RichViewEdit from previous documents?
I need to clear all styles, get defaults etc.
The problem I've got is when I clear RVE and RVStyle the documents here will get fixed width ignoring window size and RVRuler doesn't helps.
Word wrap works fine if window/form size is smaller than RVE document width. And when form width is smaller then document width bottom scrollbar appears.
Here is my code to clear RVE:
And once document width changed with RVRuler it becames fixed and when I make main form smaller than that width - I get bottom scrollbar. How can I bring dynamic document width back?
I need to clear all styles, get defaults etc.
The problem I've got is when I clear RVE and RVStyle the documents here will get fixed width ignoring window size and RVRuler doesn't helps.
Word wrap works fine if window/form size is smaller than RVE document width. And when form width is smaller then document width bottom scrollbar appears.
Here is my code to clear RVE:
Code: Select all
RichViewEdit1.Clear;
RVStyle1.TextStyles.Clear;
RVRuler1.AdjustPosition;
RichViewEdit1.ApplyStyleConversion(TEXT_APPLYSTYLE);
// This will apply my default style:
// FontInfo.FontName:=EditorFontName;
// FontInfo.Size:=EditorFontSize;
// FontInfo.Color:=DefTextColor;
// FontInfo.BackColor:=clNone;
// FontInfo.Style:=[];
// ...
// NewStyleNo:=RVStyle1.TextStyles.FindSuchStyle(StyleNo,FontInfo,RVAllFontInfoProperties);
// if NewStyleNo=-1 then begin
// RVStyle1.TextStyles.Add;
// ...