MFC background color
-
Hello, i'm a newbie in MFC programming and I'm writing a simple and silly program that change the background color of the window by selecting the color in the Menù. I've created a menù with 5 color and each color has its own ID message. I put the handler of these messages in the Document class of the program: i don't know if this is correct. How can I change the color of background? I'm a bit confused because I would like to invalidate the client area and set the new color in OnDraw Method but I can't invalidate the area because if i put Invalidate() in the handler of the menù i get error. These questions could be silly and obvious for an expert user but I don't know how to proceed. Can anyone suggest me the way to do? Best regards.
-
Hello, i'm a newbie in MFC programming and I'm writing a simple and silly program that change the background color of the window by selecting the color in the Menù. I've created a menù with 5 color and each color has its own ID message. I put the handler of these messages in the Document class of the program: i don't know if this is correct. How can I change the color of background? I'm a bit confused because I would like to invalidate the client area and set the new color in OnDraw Method but I can't invalidate the area because if i put Invalidate() in the handler of the menù i get error. These questions could be silly and obvious for an expert user but I don't know how to proceed. Can anyone suggest me the way to do? Best regards.
What type of view are you using? What error do you get when you call
Invalidate()
?The difficult we do right away... ...the impossible takes slightly longer.
-
What type of view are you using? What error do you get when you call
Invalidate()
?The difficult we do right away... ...the impossible takes slightly longer.
If i put Invalidate(); in the handler I get the message: "error C3861: 'Invalidate': identifier not found I have a doubt: Invalidate is a method of Cview class and I call this function inside a method of CDocument class. Is this calling correct? How can I call a method of a class inside a method of another class?
-
If i put Invalidate(); in the handler I get the message: "error C3861: 'Invalidate': identifier not found I have a doubt: Invalidate is a method of Cview class and I call this function inside a method of CDocument class. Is this calling correct? How can I call a method of a class inside a method of another class?