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. C++ program

C++ program

Scheduled Pinned Locked Moved C / C++ / MFC
c++tutorial
5 Posts 4 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.
  • N Offline
    N Offline
    namoorthy
    wrote on last edited by
    #1

    How to change font color and backround color C++ program

    L 1 Reply Last reply
    0
    • N namoorthy

      How to change font color and backround color C++ program

      L Offline
      L Offline
      Leyu
      wrote on last edited by
      #2

      In CView::OnDraw(CDC* pDC) or using the CDC *pDC=GetDC() member function //To Set font color COLORREF oldCol=pDC->SetTextColor (RGB(0,0,255));//Blue Color // use font to draw stuff //..... pDC->SetTextColor (oldCol);//restore old font color //the same Way to set back ground color COLORREF OldbkColor=pDC->SetBkColor (RGB(0,0,0)); //Do your drawing //...... //if U want to restore BK Color pDC->SetBkColor(OldbkColor);

      T 1 Reply Last reply
      0
      • L Leyu

        In CView::OnDraw(CDC* pDC) or using the CDC *pDC=GetDC() member function //To Set font color COLORREF oldCol=pDC->SetTextColor (RGB(0,0,255));//Blue Color // use font to draw stuff //..... pDC->SetTextColor (oldCol);//restore old font color //the same Way to set back ground color COLORREF OldbkColor=pDC->SetBkColor (RGB(0,0,0)); //Do your drawing //...... //if U want to restore BK Color pDC->SetBkColor(OldbkColor);

        T Offline
        T Offline
        toxcct
        wrote on last edited by
        #3

        what about dialog based programs ?


        TOXCCT >>> GEII power

        L A 2 Replies Last reply
        0
        • T toxcct

          what about dialog based programs ?


          TOXCCT >>> GEII power

          L Offline
          L Offline
          Leyu
          wrote on last edited by
          #4

          see this arrticles http://www.codeguru.com/Cpp/W-D/dislog/background/article.php/c1849/ http://www.codeguru.com/Cpp/W-D/dislog/background/article.php/c1895/

          1 Reply Last reply
          0
          • T toxcct

            what about dialog based programs ?


            TOXCCT >>> GEII power

            A Offline
            A Offline
            Aamir Butt
            wrote on last edited by
            #5

            For dialog based programs, you will have to override a handler WM_CTLCOLOR. This can change the colors of all the controls on a dialog and the color of the dialog itself. STUCK           STUCK           STUCK           STUCK Stuck to Programming through an unbreakable bond :( My Articles | My Blog

            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