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. [Message Deleted]

[Message Deleted]

Scheduled Pinned Locked Moved C / C++ / MFC
8 Posts 6 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.
  • Y Offline
    Y Offline
    yogendra kaushik
    wrote on last edited by
    #1

    [Message Deleted]

    _ V M T 4 Replies Last reply
    0
    • Y yogendra kaushik

      [Message Deleted]

      _ Offline
      _ Offline
      _AnsHUMAN_
      wrote on last edited by
      #2

      This will help :

      HBRUSH CtestMFCDlg::OnCtlColor(CDC* pDC, CWnd* pWnd, UINT nCtlColor)
      {
        HBRUSH hbr = CDialog::OnCtlColor(pDC, pWnd, nCtlColor);
        if(nCtlColor== CTLCOLOR_EDIT )
             hbr=CreateSolidBrush(RGB(0,100,0));
        return hbr;
      }
      

      Somethings seem HARD to do, until we know how to do them. ;-) _AnShUmAn_

      Y F 2 Replies Last reply
      0
      • Y yogendra kaushik

        [Message Deleted]

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

        If you are doing this in OnCtlColor handler for WM_CTLCOLOR notification, and you want to affect the colours of all of edit boxes, then you can try the last argument of OnCtlColor, which describes the type of control:

        HBRUSH CMyDialog::OnCtlColor( CDC * pDC, CWnd * pWnd, UINT nCtlColor)
        {
            if(nCtlColor == CTLCOLOR_EDIT)
            {
                // set the colour
                . . .
            }
            else
            {
                // do not set the colour
                return CDialog::OnCtlColor(pDC, pWnd, nCtlColor);
            }
        }
        

        Hope it helps.

        Y 1 Reply Last reply
        0
        • Y yogendra kaushik

          [Message Deleted]

          M Offline
          M Offline
          Maximilien
          wrote on last edited by
          #4

          Add a class variable that holds the color, and for each edit box, modify that variable.


          Maximilien Lincourt Your Head A Splode - Strong Bad

          1 Reply Last reply
          0
          • V Viorel

            If you are doing this in OnCtlColor handler for WM_CTLCOLOR notification, and you want to affect the colours of all of edit boxes, then you can try the last argument of OnCtlColor, which describes the type of control:

            HBRUSH CMyDialog::OnCtlColor( CDC * pDC, CWnd * pWnd, UINT nCtlColor)
            {
                if(nCtlColor == CTLCOLOR_EDIT)
                {
                    // set the colour
                    . . .
                }
                else
                {
                    // do not set the colour
                    return CDialog::OnCtlColor(pDC, pWnd, nCtlColor);
                }
            }
            

            Hope it helps.

            Y Offline
            Y Offline
            yogendra kaushik
            wrote on last edited by
            #5

            THANKS A ..... ..................LOT Please mail me

            1 Reply Last reply
            0
            • _ _AnsHUMAN_

              This will help :

              HBRUSH CtestMFCDlg::OnCtlColor(CDC* pDC, CWnd* pWnd, UINT nCtlColor)
              {
                HBRUSH hbr = CDialog::OnCtlColor(pDC, pWnd, nCtlColor);
                if(nCtlColor== CTLCOLOR_EDIT )
                     hbr=CreateSolidBrush(RGB(0,100,0));
                return hbr;
              }
              

              Somethings seem HARD to do, until we know how to do them. ;-) _AnShUmAn_

              Y Offline
              Y Offline
              yogendra kaushik
              wrote on last edited by
              #6

              THANKS A LOT Please mail me

              1 Reply Last reply
              0
              • _ _AnsHUMAN_

                This will help :

                HBRUSH CtestMFCDlg::OnCtlColor(CDC* pDC, CWnd* pWnd, UINT nCtlColor)
                {
                  HBRUSH hbr = CDialog::OnCtlColor(pDC, pWnd, nCtlColor);
                  if(nCtlColor== CTLCOLOR_EDIT )
                       hbr=CreateSolidBrush(RGB(0,100,0));
                  return hbr;
                }
                

                Somethings seem HARD to do, until we know how to do them. ;-) _AnShUmAn_

                F Offline
                F Offline
                FarPointer
                wrote on last edited by
                #7

                We should use the reflect message =WM_CTLCOLOR on CMyEdit more OOPs Oriented. Regards, FarPointer Blog:http://farpointer.blogspot.com/

                1 Reply Last reply
                0
                • Y yogendra kaushik

                  [Message Deleted]

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

                  stop deleting your questions when someone gives you the answer you were looking for. it's not the first time i say you this, and you still behave like a SELFISH man :mad: if you don't want others to see the answer anymore, then don't ask it here ; find a friend and ask him whatever you like. but here (and in a general mean on forums), things are written to be read after a more or less time since it was written X| isn't it Mr. Gourav ?! :doh:


                  TOXCCT >>> GEII power

                  [VisualCalc 3.0 updated ][Flags Beginner's Guide new! ]

                  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