trichview.com

trichview.support




Re: TRichView.Clear while it is active


Return to index


Author

Message

Sergey Tkachenko

Posted: 09/05/2003 18:27:30


When do call TRichView.Clear? Inside ComboBox.OnClick/OnChange?

TRichView.Clear destroys this ComboBox, and VCL does expect this inside

ComboBox.OnClick/OnChange.


If the solution with activecontrol works - use it.

Another solution - to post a message to the form (using PostMessage) and

clear the document in this message handler.




>

> Hello again,

>

> here is another strange behaviour of RichView

> I have a combobox control in the document, an I need to refresh document

> contents if combobox value is changed.

> But the TRichView.Clear method throws exception (access violation) because

> (as I found out) RichView is an active component.

> If I am not mistaken an attempt to free the active combobox causes this

error.

>

> here is a quite ugly workaround I used to eliminate the problem

>

>   TCustomForm(RichViewDoc.Owner).ActiveControl := nil;

>

> after this call the Clear method works ok,

> but there must be another solution, isn't it?





Powered by ABC Amber Outlook Express Converter