?
Solved

DHTMLEdit Cell Background Image

Posted on 2002-05-06
5
Medium Priority
?
298 Views
Last Modified: 2010-04-04
DHTMLEdit Cell Background Image

How to insert and change cell background image ?

Thanks.
0
Comment
Question by:treqw
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 3
  • 2
5 Comments
 
LVL 17

Accepted Solution

by:
inthe earned 2000 total points
ID: 6992767
hi,
you should be able to reference it like this:

(DHTMLEdit1.DOM.all.item('id1', 0) as IHTMLElement).setAttribute('background', 'D:\spawntest.jpg', 0);

where cell has a id of id1
<td id=id1>
and after tag should end up like:
<td id=id1 background=D:\spawntest.jpg>

if you have kpro read this q on same topic for free:
http://www.experts-exchange.com/delphi/Q.20297195.html
0
 

Author Comment

by:treqw
ID: 6993204
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.
0
 

Author Comment

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

Thanks.
0
 
LVL 17

Expert Comment

by:inthe
ID: 6995420
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;

0
 
LVL 17

Expert Comment

by:inthe
ID: 6995425
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
0

Featured Post

Industry Leaders: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Hello everybody This Article will show you how to validate number with TEdit control, What's the TEdit control? TEdit is a standard Windows edit control on a form, it allows to user to write, read and copy/paste single line of text. Usua…
Introduction Raise your hands if you were as upset with FireMonkey as I was when I discovered that there was no TListview.  I use TListView in almost all of my applications I've written, and I was not going to compromise by resorting to TStringGrid…
In this video we outline the Physical Segments view of NetCrunch network monitor. By following this brief how-to video, you will be able to learn how NetCrunch visualizes your network, how granular is the information collected, as well as where to f…
In this brief tutorial Pawel from AdRem Software explains how you can quickly find out which services are running on your network, or what are the IP addresses of servers responsible for each service. Software used is freeware NetCrunch Tools (https…
Suggested Courses
Course of the Month14 days, 4 hours left to enroll

800 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question