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. CStatic WS_VISIBLE how to repaint ? (newbies)

CStatic WS_VISIBLE how to repaint ? (newbies)

Scheduled Pinned Locked Moved C / C++ / MFC
questionc++helptutorial
4 Posts 1 Posters 3 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.
  • L Offline
    L Offline
    Lost User
    wrote on last edited by
    #1

    Hi all, I have trouble refreshing one static text after having set it to WM_VISIBLE off if I minimize & maximise again the static is gone but how can I send order to refresh the static text directly. I tried already invalidatrect drawwindows() and some other solutions, nothing work. I suppose that I should invalidat the Cstatic object (in fact the excellent CLabel class derived from CStatic) then send a WM_PAINT to the main but I don't know how to exactly do this following the rules to get clean code. (I'm newbies at MFC) Thanks for any help Dany

    L 2 Replies Last reply
    0
    • L Lost User

      Hi all, I have trouble refreshing one static text after having set it to WM_VISIBLE off if I minimize & maximise again the static is gone but how can I send order to refresh the static text directly. I tried already invalidatrect drawwindows() and some other solutions, nothing work. I suppose that I should invalidat the Cstatic object (in fact the excellent CLabel class derived from CStatic) then send a WM_PAINT to the main but I don't know how to exactly do this following the rules to get clean code. (I'm newbies at MFC) Thanks for any help Dany

      L Offline
      L Offline
      Lost User
      wrote on last edited by
      #2

      Using WS_VISIBLE is similar to using the following function: ShowWindow(hwnd, SW_HIDE); //This hides the window! To re-show or make visible: ShowWindow(hwnd, SW_SHOW); Mh2! :)

      1 Reply Last reply
      0
      • L Lost User

        Hi all, I have trouble refreshing one static text after having set it to WM_VISIBLE off if I minimize & maximise again the static is gone but how can I send order to refresh the static text directly. I tried already invalidatrect drawwindows() and some other solutions, nothing work. I suppose that I should invalidat the Cstatic object (in fact the excellent CLabel class derived from CStatic) then send a WM_PAINT to the main but I don't know how to exactly do this following the rules to get clean code. (I'm newbies at MFC) Thanks for any help Dany

        L Offline
        L Offline
        Lost User
        wrote on last edited by
        #3

        don't set id of the static control to id_static, it must unique:)

        L 1 Reply Last reply
        0
        • L Lost User

          don't set id of the static control to id_static, it must unique:)

          L Offline
          L Offline
          Lost User
          wrote on last edited by
          #4

          Many thanks, just tried it work fine... I dealed with several API and language and was always suspicious :suss: about MFC but it's incredible what we can do in no time :laugh: I don't want to abuse but one more question: Is there a ways to avoid immediate refresh when setting SW_SHOW cause I have several static (another name of course ;) ) to show and even if it's fast we can see that they come up one by one. something like : DisableWindowsUpdate(); ..SW_SHOW ..SW_SHOW ... EnableWindowsUpdate(); Again thanks it will be my last question (for this thread of course ):cool:

          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