When I tried loading a document before showing a form, I sometimes got an exception. In order to avoid it, I changed the method ScrollBarVChange in the unit SclRView:
if OldValue <> VScrollPos then begin
if FRichViewEdit.Visible then // <==== Added line
If not FRichViewEdit.Focused then
FRichViewEdit.SetFocus;
I changed the code as suggested, and now I am getting (a lot of) errors List index out of bounds. Are you sure that ve. format is not necessary after DeleteUnusedStyles, NormalizeRichView, ClearUndo? Please advise.
I use EurekaLog to log the errors, but I do not have the documents that were being used when the errors happened - the documents are retrieved from a database, and the users somehow keep working after the error message. Anyway, this is not important - I will simply patch the source file, so that the control do not receive focus if it is not visible.