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. Regarding Back ground color.

Regarding Back ground color.

Scheduled Pinned Locked Moved C / C++ / MFC
help
3 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.
  • N Offline
    N Offline
    Neelesh K J Jain
    wrote on last edited by
    #1

    Hello Friends, I have 3 edit boxes in which I enter the values of RGB respectively. Whenever there is a change of value in the edit boxes, I display the appropraite color based on the inputted values in a picture control. My main problem lies, if I resize the window, then the color displayed in the picture control is gone, so for displaying it again, i have to change the value of edit box. So, please help me regarding this one so that even if i resize the window, the colour is shown to the user. Even I had included OnPaint() function and calling the color display, then it is flickering. Please help me. :( :doh: Thanks in Advance.

    C J 2 Replies Last reply
    0
    • N Neelesh K J Jain

      Hello Friends, I have 3 edit boxes in which I enter the values of RGB respectively. Whenever there is a change of value in the edit boxes, I display the appropraite color based on the inputted values in a picture control. My main problem lies, if I resize the window, then the color displayed in the picture control is gone, so for displaying it again, i have to change the value of edit box. So, please help me regarding this one so that even if i resize the window, the colour is shown to the user. Even I had included OnPaint() function and calling the color display, then it is flickering. Please help me. :( :doh: Thanks in Advance.

      C Offline
      C Offline
      Cedric Moonen
      wrote on last edited by
      #2

      Check for the WM_SIZE event (OnSize() function).

      1 Reply Last reply
      0
      • N Neelesh K J Jain

        Hello Friends, I have 3 edit boxes in which I enter the values of RGB respectively. Whenever there is a change of value in the edit boxes, I display the appropraite color based on the inputted values in a picture control. My main problem lies, if I resize the window, then the color displayed in the picture control is gone, so for displaying it again, i have to change the value of edit box. So, please help me regarding this one so that even if i resize the window, the colour is shown to the user. Even I had included OnPaint() function and calling the color display, then it is flickering. Please help me. :( :doh: Thanks in Advance.

        J Offline
        J Offline
        John R Shaw
        wrote on last edited by
        #3

        It sounds like you are just redrawing the control in a new color and not setting it to the new color. In orther words, you should be calling a function that changes the drawing color of the control so that when it is being repainted it uses the new color. You should not need to define your own OnPaint() function to accomplish this. The flickering is noramaly caused by the OnEraseBkgnd(). INTP "The more help VB provides VB programmers, the more miserable your life as a C++ programmer becomes." Andrew W. Troelsen

        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