Right now, I am setting the background colour like this,
dc.DrawRectangle(0,0,width,height)
Do you know a better way to set the background color?
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
The normal way, which works for most windows, including buttons and other widgets is to call wxWindow::SetBackgroundColour()
http://docs.wxwidgets.org/2.8/wx_wxwindow.html#wxwindowsetbackgroundcolour
The neat thing is that if you call this on the topmost parent, all the children will automatically inherit the same background colour. See the link for how exactly this works.