[2 days left] What’s wrong with your cloud strategy? Learn why multicloud solutions matter with Nimble Storage.Register Now

x
?
Solved

DHTMLEdit Cell Background Image

Posted on 2002-05-06
5
Medium Priority
?
300 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

On Demand Webinar: Networking for the Cloud Era

Did you know SD-WANs can improve network connectivity? Check out this webinar to learn how an SD-WAN simplified, one-click tool can help you migrate and manage data in the cloud.

Question has a verified solution.

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

The uses clause is one of those things that just tends to grow and grow. Most of the time this is in the main form, as it's from this form that all others are called. If you have a big application (including many forms), the uses clause in the in…
Objective: - This article will help user in how to convert their numeric value become words. How to use 1. You can copy this code in your Unit as function 2. than you can perform your function by type this code The Code   (CODE) The Im…
Visualize your data even better in Access queries. Given a date and a value, this lesson shows how to compare that value with the previous value, calculate the difference, and display a circle if the value is the same, an up triangle if it increased…
Are you ready to place your question in front of subject-matter experts for more timely responses? With the release of Priority Question, Premium Members, Team Accounts and Qualified Experts can now identify the emergent level of their issue, signal…
Suggested Courses

656 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