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. How to Change the Blue Selection Color in Edit Control

How to Change the Blue Selection Color in Edit Control

Scheduled Pinned Locked Moved C / C++ / MFC
tutorialc++
5 Posts 2 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.
  • V Offline
    V Offline
    vishalgpt
    wrote on last edited by
    #1

    Hi Everybody, I want to change the color of selecting text in an edit control and I ran out of ideas. I am totally confused, please anyone guide. It is a WIN32 C++ Application.

    Regards, Vishal

    D 1 Reply Last reply
    0
    • V vishalgpt

      Hi Everybody, I want to change the color of selecting text in an edit control and I ran out of ideas. I am totally confused, please anyone guide. It is a WIN32 C++ Application.

      Regards, Vishal

      D Offline
      D Offline
      David Crow
      wrote on last edited by
      #2

      That's a Windows setting. You can change it via code, but that may end up irritating the user. In any case, see SetSysColors() and COLOR_HIGHLIGHT.

      "One man's wage rise is another man's price increase." - Harold Wilson

      "Fireproof doesn't mean the fire will never come. It means when the fire comes that you will be able to withstand it." - Michael Simmons

      "Show me a community that obeys the Ten Commandments and I'll show you a less crowded prison system." - Anonymous

      V 1 Reply Last reply
      0
      • D David Crow

        That's a Windows setting. You can change it via code, but that may end up irritating the user. In any case, see SetSysColors() and COLOR_HIGHLIGHT.

        "One man's wage rise is another man's price increase." - Harold Wilson

        "Fireproof doesn't mean the fire will never come. It means when the fire comes that you will be able to withstand it." - Michael Simmons

        "Show me a community that obeys the Ten Commandments and I'll show you a less crowded prison system." - Anonymous

        V Offline
        V Offline
        vishalgpt
        wrote on last edited by
        #3

        SetSysColors() works, but it had changed the default COLOR_HIGHLIGHT color to BLACK, I had used RGB(0,0,0) This function changes the global highlight color, I want to change highlight color of my edit control only. How to achieve this.

        Regards, Vishal

        D 1 Reply Last reply
        0
        • V vishalgpt

          SetSysColors() works, but it had changed the default COLOR_HIGHLIGHT color to BLACK, I had used RGB(0,0,0) This function changes the global highlight color, I want to change highlight color of my edit control only. How to achieve this.

          Regards, Vishal

          D Offline
          D Offline
          David Crow
          wrote on last edited by
          #4

          vishalgpt wrote:

          I want to change highlight color of my edit control only.
           
          How to achieve this.

          Custom control.

          "One man's wage rise is another man's price increase." - Harold Wilson

          "Fireproof doesn't mean the fire will never come. It means when the fire comes that you will be able to withstand it." - Michael Simmons

          "Show me a community that obeys the Ten Commandments and I'll show you a less crowded prison system." - Anonymous

          V 1 Reply Last reply
          0
          • D David Crow

            vishalgpt wrote:

            I want to change highlight color of my edit control only.
             
            How to achieve this.

            Custom control.

            "One man's wage rise is another man's price increase." - Harold Wilson

            "Fireproof doesn't mean the fire will never come. It means when the fire comes that you will be able to withstand it." - Michael Simmons

            "Show me a community that obeys the Ten Commandments and I'll show you a less crowded prison system." - Anonymous

            V Offline
            V Offline
            vishalgpt
            wrote on last edited by
            #5

            Hi, I was guessing the same, but i am creating a win32 application, 1) Sould i go with MFC 2) Or Subclass existing edit control in win32 c++ Or some other way if exists:...

            Regards, Vishal

            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