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. A RichEdit without any borders [Solved]

A RichEdit without any borders [Solved]

Scheduled Pinned Locked Moved C / C++ / MFC
announcementc++wpftutorialquestion
6 Posts 3 Posters 0 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.
  • R Offline
    R Offline
    Rozis
    wrote on last edited by
    #1

    I'm trying to create a RichEdit without any borders tried to set off ES_SUNKEN, WS_EX_CLIENTEDGE but nothing works: it keeps coming with that ugly sunken border. Has anyone a clue, or better, an example in C or C++? PS. of cource ES_MULTILINE,ES_AUTOHSCROLL,ES_AUTOVSCROLL are on... Thanks in advance... Rozis [Update] I found out i was still using version 1. Did some changes to support version 3 and 4.1. Because the control displays correctly (apart from that ugly border) I conclude this code must be ok. WS_EX_CLIENTEDGE ultimatly leads to SetWindowLong(). So I thought to be smart and set everything off, like this: SetWindowLong(whnd,GWL_EXSTYLE,0) To my surprise it still displays the border! What i want to get rid off is WS_BORDER, WS_EX_CLIENTEDGE and WS_EX_STATICEDGE. For version 4.1 I use Loadlibrary("MSFTEDIT.DLL") and classname "RichEdit50W". The MS-documentation says not all styles are implemented, so i thought maybe it is not possible. Your reactions indicate i'm not right... But i still can get it to work. Someone any (win32) suggestions? [Solved] Used Spy+ to find out wich styles where there. Used Setwindowlong() to put the styles in. I think this was a quirk of my gui-classes Thanks anyway [End Update]

    modified on Friday, July 2, 2010 4:15 PM

    N X 2 Replies Last reply
    0
    • R Rozis

      I'm trying to create a RichEdit without any borders tried to set off ES_SUNKEN, WS_EX_CLIENTEDGE but nothing works: it keeps coming with that ugly sunken border. Has anyone a clue, or better, an example in C or C++? PS. of cource ES_MULTILINE,ES_AUTOHSCROLL,ES_AUTOVSCROLL are on... Thanks in advance... Rozis [Update] I found out i was still using version 1. Did some changes to support version 3 and 4.1. Because the control displays correctly (apart from that ugly border) I conclude this code must be ok. WS_EX_CLIENTEDGE ultimatly leads to SetWindowLong(). So I thought to be smart and set everything off, like this: SetWindowLong(whnd,GWL_EXSTYLE,0) To my surprise it still displays the border! What i want to get rid off is WS_BORDER, WS_EX_CLIENTEDGE and WS_EX_STATICEDGE. For version 4.1 I use Loadlibrary("MSFTEDIT.DLL") and classname "RichEdit50W". The MS-documentation says not all styles are implemented, so i thought maybe it is not possible. Your reactions indicate i'm not right... But i still can get it to work. Someone any (win32) suggestions? [Solved] Used Spy+ to find out wich styles where there. Used Setwindowlong() to put the styles in. I think this was a quirk of my gui-classes Thanks anyway [End Update]

      modified on Friday, July 2, 2010 4:15 PM

      N Offline
      N Offline
      Niklas L
      wrote on last edited by
      #2

      This works ok over here

      ...
      AfxInitRichEdit2();
      ...
      DWORD dwStyle = ES_MULTILINE | ES_AUTOVSCROLL | ES_AUTOHSCROLL | ES_WANTRETURN | WS_TABSTOP | WS_VISIBLE;

      CRect rc(200, 200, 600, 600);
      //CRichEditCtrl wndRichEdit;
      wndRichEdit.Create(dwStyle, rc, pWndParent, 30000);

      If you create the control in the resource editor, all you have to do is set Border to false

      home

      R 1 Reply Last reply
      0
      • R Rozis

        I'm trying to create a RichEdit without any borders tried to set off ES_SUNKEN, WS_EX_CLIENTEDGE but nothing works: it keeps coming with that ugly sunken border. Has anyone a clue, or better, an example in C or C++? PS. of cource ES_MULTILINE,ES_AUTOHSCROLL,ES_AUTOVSCROLL are on... Thanks in advance... Rozis [Update] I found out i was still using version 1. Did some changes to support version 3 and 4.1. Because the control displays correctly (apart from that ugly border) I conclude this code must be ok. WS_EX_CLIENTEDGE ultimatly leads to SetWindowLong(). So I thought to be smart and set everything off, like this: SetWindowLong(whnd,GWL_EXSTYLE,0) To my surprise it still displays the border! What i want to get rid off is WS_BORDER, WS_EX_CLIENTEDGE and WS_EX_STATICEDGE. For version 4.1 I use Loadlibrary("MSFTEDIT.DLL") and classname "RichEdit50W". The MS-documentation says not all styles are implemented, so i thought maybe it is not possible. Your reactions indicate i'm not right... But i still can get it to work. Someone any (win32) suggestions? [Solved] Used Spy+ to find out wich styles where there. Used Setwindowlong() to put the styles in. I think this was a quirk of my gui-classes Thanks anyway [End Update]

        modified on Friday, July 2, 2010 4:15 PM

        X Offline
        X Offline
        Xeqtr 0
        wrote on last edited by
        #3

        Look there http://msdn.microsoft.com/en-us/library/bb787873(VS.85).aspx I guess that your form style like win98. To turn on XP or later versions style, include this code:

        #if defined _M_IX86
        #pragma comment(linker,"/manifestdependency:\"type='win32' name='Microsoft.Windows.Common-Controls' version='6.0.0.0' processorArchitecture='x86' publicKeyToken='6595b64144ccf1df' language='*'\"")
        #elif defined _M_IA64
        #pragma comment(linker,"/manifestdependency:\"type='win32' name='Microsoft.Windows.Common-Controls' version='6.0.0.0' processorArchitecture='ia64' publicKeyToken='6595b64144ccf1df' language='*'\"")
        #elif defined _M_X64
        #pragma comment(linker,"/manifestdependency:\"type='win32' name='Microsoft.Windows.Common-Controls' version='6.0.0.0' processorArchitecture='amd64' publicKeyToken='6595b64144ccf1df' language='*'\"")
        #else
        #pragma comment(linker,"/manifestdependency:\"type='win32' name='Microsoft.Windows.Common-Controls' version='6.0.0.0' processorArchitecture='*' publicKeyToken='6595b64144ccf1df' language='*'\""
        #endif

        R 1 Reply Last reply
        0
        • X Xeqtr 0

          Look there http://msdn.microsoft.com/en-us/library/bb787873(VS.85).aspx I guess that your form style like win98. To turn on XP or later versions style, include this code:

          #if defined _M_IX86
          #pragma comment(linker,"/manifestdependency:\"type='win32' name='Microsoft.Windows.Common-Controls' version='6.0.0.0' processorArchitecture='x86' publicKeyToken='6595b64144ccf1df' language='*'\"")
          #elif defined _M_IA64
          #pragma comment(linker,"/manifestdependency:\"type='win32' name='Microsoft.Windows.Common-Controls' version='6.0.0.0' processorArchitecture='ia64' publicKeyToken='6595b64144ccf1df' language='*'\"")
          #elif defined _M_X64
          #pragma comment(linker,"/manifestdependency:\"type='win32' name='Microsoft.Windows.Common-Controls' version='6.0.0.0' processorArchitecture='amd64' publicKeyToken='6595b64144ccf1df' language='*'\"")
          #else
          #pragma comment(linker,"/manifestdependency:\"type='win32' name='Microsoft.Windows.Common-Controls' version='6.0.0.0' processorArchitecture='*' publicKeyToken='6595b64144ccf1df' language='*'\""
          #endif

          R Offline
          R Offline
          Rozis
          wrote on last edited by
          #4

          I'm not using MS-stuff. Do you know if there's a win32 equivalent? Thanks, Rozis

          1 Reply Last reply
          0
          • N Niklas L

            This works ok over here

            ...
            AfxInitRichEdit2();
            ...
            DWORD dwStyle = ES_MULTILINE | ES_AUTOVSCROLL | ES_AUTOHSCROLL | ES_WANTRETURN | WS_TABSTOP | WS_VISIBLE;

            CRect rc(200, 200, 600, 600);
            //CRichEditCtrl wndRichEdit;
            wndRichEdit.Create(dwStyle, rc, pWndParent, 30000);

            If you create the control in the resource editor, all you have to do is set Border to false

            home

            R Offline
            R Offline
            Rozis
            wrote on last edited by
            #5

            And what about WS_EX_CLIENTEDGE and WS_EX_STATICEDGE?

            N 1 Reply Last reply
            0
            • R Rozis

              And what about WS_EX_CLIENTEDGE and WS_EX_STATICEDGE?

              N Offline
              N Offline
              Niklas L
              wrote on last edited by
              #6

              What about them? Did I maybe misunderstand your problem? The code I supplied creates a CRichEditCtrl without any borders at all. I tested it on my end. Was that not what you wanted?

              home

              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