Link to home
Start Free TrialLog in
Avatar of treqw
treqw

asked on

DHTMLEdit Cell Background Image

DHTMLEdit Cell Background Image

How to insert and change cell background image ?

Thanks.
ASKER CERTIFIED SOLUTION
Avatar of inthe
inthe

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of treqw
treqw

ASKER

If I select object (cell, page, etc...) in DHTMLEdit, I want to recognite selection in text.

Like that :
Selected part of page is :
<td id=id1 background=D:\spawntest.jpg>

Thanks.
Avatar of treqw

ASKER

And when I find selected part in DHTMLEdit I want to do change. I'm doing that with ID, or some other way ?

Thanks.
hi,
just ignore ReplaceInfo(St);
it is someones private function and unless they tell you it you never know.
i dont know what they were trying to do but it looks like all you need to do to replace the text is to :
do it like:
 

var
HTMLDoc : IHTMLDocument2;
Selection : IHTMLSelectionObject;
TextRange : IHTMLTxtRange;
St : String;
begin
HTMLDoc := DHTMLEdit1.DOM as IHTMLDocument2;
Selection := HTMLDoc.Selection as IHTMLSelectionObject;
if Selection.type_ = 'Text' then
begin
TextRange := Selection.CreateRange as IHTMLTxtRange;
St := DHTMLEdit1.FilterSourceCode(TextRange.htmlText);
St := 'hello';
TextRange.pasteHTML(St);
end;
end;

if you want to know what the text is thats is being replaced st contains it here:

<snip>
St := DHTMLEdit1.FilterSourceCode(TextRange.htmlText);
showmessage(st); //current selected text
St := 'hello'; //now change it