Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
  1. Home
  2. General Programming
  3. C / C++ / MFC
  4. Problem with PARAFORMAT2 with PFM_BORDER [modified]

Problem with PARAFORMAT2 with PFM_BORDER [modified]

Scheduled Pinned Locked Moved C / C++ / MFC
help
6 Posts 2 Posters 1 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • B Offline
    B Offline
    BarnaKol
    wrote on last edited by
    #1

    hi I want to get an outside border in a Rich Edit Control using PARAFORMAT2 structure with PFM_BORDER set at the click of a button. The code is written as: OnBorder() { CRichEditCtrl& RCtrl=GetRichEditCtrl(); PARAFORMAT2 PF; ZeroMemory(&PF,sizeof(PF)); ::SendMessage(RCtrl.m_hWnd, EM_GETPARAFORMAT, 0, (LPARAM) &PF); PF.dwMask=PFM_BORDER; PF.wBorderSpace=2000; PF.wBorderWidth=5000; PF.wBorders=32|0|0; PF.cbSize=sizeof(PF); ::SendMessage(RCtrl.m_hWnd, EM_SETPARAFORMAT, 0, (LPARAM)&PF); } But I dont get the border. Please Suggest. Barna -- modified at 4:38 Wednesday 2nd May, 2007 Barna

    M 1 Reply Last reply
    0
    • B BarnaKol

      hi I want to get an outside border in a Rich Edit Control using PARAFORMAT2 structure with PFM_BORDER set at the click of a button. The code is written as: OnBorder() { CRichEditCtrl& RCtrl=GetRichEditCtrl(); PARAFORMAT2 PF; ZeroMemory(&PF,sizeof(PF)); ::SendMessage(RCtrl.m_hWnd, EM_GETPARAFORMAT, 0, (LPARAM) &PF); PF.dwMask=PFM_BORDER; PF.wBorderSpace=2000; PF.wBorderWidth=5000; PF.wBorders=32|0|0; PF.cbSize=sizeof(PF); ::SendMessage(RCtrl.m_hWnd, EM_SETPARAFORMAT, 0, (LPARAM)&PF); } But I dont get the border. Please Suggest. Barna -- modified at 4:38 Wednesday 2nd May, 2007 Barna

      M Offline
      M Offline
      Mark Salsbery
      wrote on last edited by
      #2

      I haven't tried this, but what happens if you specify a border style instead of "none"; // Outside borders, 3/4 point style PF.wBorders=32|(1<<8)|0;

      "Posting a VB.NET question in the C++ forum will end in tears." Chris Maunder

      B 1 Reply Last reply
      0
      • M Mark Salsbery

        I haven't tried this, but what happens if you specify a border style instead of "none"; // Outside borders, 3/4 point style PF.wBorders=32|(1<<8)|0;

        "Posting a VB.NET question in the C++ forum will end in tears." Chris Maunder

        B Offline
        B Offline
        BarnaKol
        wrote on last edited by
        #3

        Thanks for your response. Tried with your solution. But the problem still remais. The border does not appear. Thanks Barna Barna

        M 1 Reply Last reply
        0
        • B BarnaKol

          Thanks for your response. Tried with your solution. But the problem still remais. The border does not appear. Thanks Barna Barna

          M Offline
          M Offline
          Mark Salsbery
          wrote on last edited by
          #4

          I tested this a bit. Seems the RichEdit control (2.0+) supports the paragraph borders but doesn't/can't display them. If you copy text from your control into Word, you'll see the borders. That's as much as I know at this point :) Mark

          "Posting a VB.NET question in the C++ forum will end in tears." Chris Maunder

          B 1 Reply Last reply
          0
          • M Mark Salsbery

            I tested this a bit. Seems the RichEdit control (2.0+) supports the paragraph borders but doesn't/can't display them. If you copy text from your control into Word, you'll see the borders. That's as much as I know at this point :) Mark

            "Posting a VB.NET question in the C++ forum will end in tears." Chris Maunder

            B Offline
            B Offline
            BarnaKol
            wrote on last edited by
            #5

            Thanks again for your response. Yes I tested this too and found what you wrote. If you look at PARAFORMAT2 structure in MSDN it is written "The wBorderSpace, wBorderWidth, and wBorders members are included for compatibility with Microsoft Word; the rich edit control stores the values but does not use them to display text. To use this member, set the PFM_BORDER flag in the dwMask member." But how do I display this border. The thing is that then should I have to write sepearte code to draw a border? Another thing is that if it (PARAFORMAT2) does support wBorderSpace, wBorderWidth, and wBorders but does not display, then how do programmers use this feature or in what context does wBorderSpace, wBorderWidth, and wBorders helps programmers. Barna

            M 1 Reply Last reply
            0
            • B BarnaKol

              Thanks again for your response. Yes I tested this too and found what you wrote. If you look at PARAFORMAT2 structure in MSDN it is written "The wBorderSpace, wBorderWidth, and wBorders members are included for compatibility with Microsoft Word; the rich edit control stores the values but does not use them to display text. To use this member, set the PFM_BORDER flag in the dwMask member." But how do I display this border. The thing is that then should I have to write sepearte code to draw a border? Another thing is that if it (PARAFORMAT2) does support wBorderSpace, wBorderWidth, and wBorders but does not display, then how do programmers use this feature or in what context does wBorderSpace, wBorderWidth, and wBorders helps programmers. Barna

              M Offline
              M Offline
              Mark Salsbery
              wrote on last edited by
              #6

              BarnaKol wrote:

              But how do I display this border. The thing is that then should I have to write sepearte code to draw a border?

              When I searched for answers on this, I got the impression that it was added for version 2 of the RichEdit control but not implemented. The paragraph border settings are in the text but the control doesn't draw them. Somehow I assumed they would be drawn in later versions of the control but that is not the case, as you've seen. I'm on XP SP2 so my RichEdit control should be version 4+. I guess the control has all the features of Word these days, but we can't use them. We have to use Word :^) Mark

              "Posting a VB.NET question in the C++ forum will end in tears." Chris Maunder

              1 Reply Last reply
              0
              Reply
              • Reply as topic
              Log in to reply
              • Oldest to Newest
              • Newest to Oldest
              • Most Votes


              • Login

              • Don't have an account? Register

              • Login or register to search.
              • First post
                Last post
              0
              • Categories
              • Recent
              • Tags
              • Popular
              • World
              • Users
              • Groups