treqw
asked on
DHTMLEdit Cell Background Image
DHTMLEdit Cell Background Image
How to insert and change cell background image ?
Thanks.
How to insert and change cell background image ?
Thanks.
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
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.
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.FilterSourceCod e(TextRang e.htmlText );
St := 'hello';
TextRange.pasteHTML(St);
end;
end;
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.FilterSourceCod
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.FilterSourceCod e(TextRang e.htmlText );
showmessage(st); //current selected text
St := 'hello'; //now change it
<snip>
St := DHTMLEdit1.FilterSourceCod
showmessage(st); //current selected text
St := 'hello'; //now change it
ASKER
Like that :
Selected part of page is :
<td id=id1 background=D:\spawntest.jp
Thanks.