Solved

DHTMLEdit Paragpraph

Posted on 2002-05-12
1
274 Views
Last Modified: 2010-04-04
How to change paragraph in DHTMLEdit as is in FrontPage ?

Paragraph
  Indentation
    BeforeText
    AfterText
    IndentFirstLine
  Spacing
    Before
    After
    Word
    LineSpacing

Thanks.
0
Comment
Question by:zuipo
1 Comment
 
LVL 17

Accepted Solution

by:
inthe earned 400 total points
Comment Utility
hi,
is this what your after:

If you press Shift+Enter you get a <BR> instead of a <P>, so here is an example of how to do that automatically when you press enter.

FShiftKeyIsDownBaby : Boolean
FShiftKeyIsDownBaby  := False;
.....

procedure TFormNewMessage.DHTMLEditonkeydown(Sender: TObject);
begin
if DHTMLEdit.DOM.parentWindow.event.keyCode = VK_RETURN then
  begin
    if FShiftKeyIsDownBaby = False then
    begin
      DHTMLEdit.DOM.parentWindow.event.returnvalue := false;  {ignore this
key}
      KEYBD_EVENT(VK_SHIFT, MapVirtualKey(VK_SHIFT,0),0 ,0);    {set shift
on}
      KEYBD_EVENT(VK_RETURN, MapVirtualKey(VK_RETURN,0),0,0);   {and resend
return}
      FShiftKeyIsDownBaby := True;
    end;
  end
  else
  if FShiftKeyIsDownBaby then
    DHTMLEdit.DOM.parentWindow.event.returnvalue := false;  {ignore any
extra keys while shift is down}
end;

procedure TFormNewMessage.DHTMLEditonkeyup(Sender: TObject);
begin
  if FShiftKeyIsDownBaby then
  begin
    KEYBD_EVENT(VK_SHIFT, MapVirtualKey(VK_SHIFT,0),KEYEVENTF_KEYUP,0);
{turn off shift key}
    FShiftKeyIsDownBaby := False;
  end;
end;



ps,
you can do indents, outdents,bullet lists etc like:

var
p : olevariant;

dhtmledit1.ExecCommand(DECMD_INDENT,OLECMDEXECOPT_DONTPROMPTUSER,p);

just change the DECMD_INDENT const to one you want to use

0

Featured Post

Free Trending Threat Insights Every Day

Enhance your security with threat intelligence from the web. Get trending threat insights on hackers, exploits, and suspicious IP addresses delivered to your inbox with our free Cyber Daily.

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…
In my programming career I have only very rarely run into situations where operator overloading would be of any use in my work.  Normally those situations involved math with either overly large numbers (hundreds of thousands of digits or accuracy re…
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 video demonstrates how to create an example email signature rule for a department in a company using CodeTwo Exchange Rules. The signature will be inserted beneath users' latest emails in conversations and will be displayed in users' Sent Items…

771 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

8 Experts available now in Live!

Get 1:1 Help Now