Solved

DHTMLEdit Paragpraph

Posted on 2002-05-12
1
279 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
[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
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

On Demand Webinar - Networking for the Cloud Era

This webinar discusses:
-Common barriers companies experience when moving to the cloud
-How SD-WAN changes the way we look at networks
-Best practices customers should employ moving forward with cloud migration
-What happens behind the scenes of SteelConnect’s one-click button

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
Strange behavior when a form is closed 6 74
Multiple image collision 13 102
can't find the executable in Simulator 1 125
CheckListBox usage 3 95
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…
Introduction The parallel port is a very commonly known port, it was widely used to connect a printer to the PC, if you look at the back of your computer, for those who don't have newer computers, there will be a port with 25 pins and a small print…

742 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