Announcement

Collapse
No announcement yet.

Margins

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

  • Margins

    Has anyone out there set margins for a rich edit control? I just simply want to set a right margin for the entire control. I was browsing through the win32api.hlp file about rich edit controls and learned that the %EM_SETMARGINS for normal edit controls is not supported. I found info on setting indents,alignment etc. but nothing that said how to set the margins.

    Thanks,
    Adam Ritchie

  • #2
    You can use %EM_SETTARGETDEVICE to set a WYSIWYG page (line) width.
    It uses twips so:

    US letter width = 12240 twips. The following example sets the
    page width to US letter width, minus a left and right margin of
    1 inch each = 12240 - (1440 x 2) = 9360 twips. (1 cm = 567 twips)

    Code:
      LOCAL hDC AS LONG    'hEdit is RichEdits handle (hWnd)
     
      hDC = GetDC(hEdit)
      CALL SendMessage(hEdit, %EM_SETTARGETDEVICE, hDC, 9360)
      DeleteDc hDC

    ------------------


    [This message has been edited by Borje Hagsten (edited April 06, 2000).]

    Comment


    • #3
      Thank ya' kind sir!!!!!

      Adam Ritchie

      ------------------

      Comment

      Working...
      X