Solved

DHTMLEdit Paragpraph

Posted on 2002-05-12
1
278 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
ID: 7004594
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 Tool: SSL Checker

Scans your site and returns information about your SSL implementation and certificate. Helpful for debugging and validating your SSL configuration.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
how can i search if string exist in array ? 3 63
How to build JSON File in Delphi 6 3 46
Delphi and Access based Enumeration 9 72
update joined tables 2 55
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…
This article explains how to create forms/units independent of other forms/units object names in a delphi project. Have you ever created a form for user input in a Delphi project and then had the need to have that same form in a other Delphi proj…
Microsoft Active Directory, the widely used IT infrastructure, is known for its high risk of credential theft. The best way to test your Active Directory’s vulnerabilities to pass-the-ticket, pass-the-hash, privilege escalation, and malware attacks …

820 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