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. Embarsssing Menu Question

Embarsssing Menu Question

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

    I have a simple program with classes derived from CWinApp and CFrameWnd. In my CMainWnd public: CFrameWind child class I have a menu that has one item, Item1. If I select the item it displays "Hello World" but if I resize or move the window the client area will refresh and the text will disappear from the dc. Questions: 1. What should be in scope in OnDraw()? { } 2. What should be in scope OnMenuHelloWorld { }

    X 1 Reply Last reply
    0
    • . ...---...

      I have a simple program with classes derived from CWinApp and CFrameWnd. In my CMainWnd public: CFrameWind child class I have a menu that has one item, Item1. If I select the item it displays "Hello World" but if I resize or move the window the client area will refresh and the text will disappear from the dc. Questions: 1. What should be in scope in OnDraw()? { } 2. What should be in scope OnMenuHelloWorld { }

      X Offline
      X Offline
      X2040
      wrote on last edited by
      #2

      you must call the function that is responsible for drawing inside the OnDraw() the OnDraw function is called by the operating system when any update occurs in the program so if you resize the window this is update so the windows will call the OnDraw function inside which will call your drawing function. by this way it wont disapear

      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