Embarsssing Menu Question
-
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 { }
-
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 { }
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