Solved

DHTMLEdit Cell Background Image

Posted on 2002-05-06
5
291 Views
Last Modified: 2010-04-04
DHTMLEdit Cell Background Image

How to insert and change cell background image ?

Thanks.
0
Comment
Question by:treqw
  • 3
  • 2
5 Comments
 
LVL 17

Accepted Solution

by:
inthe earned 500 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

Why You Should Analyze Threat Actor TTPs

After years of analyzing threat actor behavior, it’s become clear that at any given time there are specific tactics, techniques, and procedures (TTPs) that are particularly prevalent. By analyzing and understanding these TTPs, you can dramatically enhance your security program.

Join & Write a Comment

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…
Have you ever had your Delphi form/application just hanging while waiting for data to load? This is the article to read if you want to learn some things about adding threads for data loading in the background. First, I'll setup a general applica…
This video shows how to remove a single email address from the Outlook 2010 Auto Suggestion memory. NOTE: For Outlook 2016 and 2013 perform the exact same steps. Open a new email: Click the New email button in Outlook. Start typing the address: …
This tutorial demonstrates a quick way of adding group price to multiple Magento products.

744 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

Need Help in Real-Time?

Connect with top rated Experts

12 Experts available now in Live!

Get 1:1 Help Now