Question

I know this component is not be supported anymore, but it still a very good WYSIWYG html editor. The problem is I don't know how to load a doc right after the form create. The help file of the ProfDHTMLEdit says I have to use its own OnCreate event, but I am still getting error.

procedure TfrmNote.EditorCreate(Sender: TObject);
begin
  Editor.InsertHTML('<b> test </b>');
end;

Any help will be grateful.

Was it helpful?

Solution

I vaguely remember the details behind using it...but you have to check .CanSetSource and only set the .Source when that property is true.

It doesn't always flip to true until after the form is ready to be shown so one way around it is to add a timer that fires checking the value of that .CanSetSource property and when it finally flips to true, then set the .Source to the desired text.

There's probably a more elegant approach, but this seem to work.

OTHER TIPS

Actually, the IE upgraded with a lot changes, this component is no more worth to work with. I finally found a work around. I create a webpage and embed a CKEditor in it. This editor works perfect as a WYSIWYG html editor. When finish editing, submit the editor content to the database. I use this solution for 1 year now, so far so good.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top