OnPaint overriding?
-
Hi! How would the code for overriding the OnPaint() function look like? I have been trying to set the color of a slider I created with MFC. I managed to color it's background but didn't manage to change the slider "knob" or "path" color, how is this done? I also have a Combobox wich I would like to change the color of as well, but it didn't work out either. Then there's the frame of the window, I beieve I should override OnNcPaint() function for this but either I'm wrong or doig it wrong. =) And changing the color of the entire application menu would be very nice if I could do this too. Thanks in advance! /Fredrik
-
Hi! How would the code for overriding the OnPaint() function look like? I have been trying to set the color of a slider I created with MFC. I managed to color it's background but didn't manage to change the slider "knob" or "path" color, how is this done? I also have a Combobox wich I would like to change the color of as well, but it didn't work out either. Then there's the frame of the window, I beieve I should override OnNcPaint() function for this but either I'm wrong or doig it wrong. =) And changing the color of the entire application menu would be very nice if I could do this too. Thanks in advance! /Fredrik
OnPaint() is the wrong way to do it. You can change the thumb and track colors pretty easily using custom draw. As for the combobox, look up the docs on CWnd::OnCtlColor().
-
OnPaint() is the wrong way to do it. You can change the thumb and track colors pretty easily using custom draw. As for the combobox, look up the docs on CWnd::OnCtlColor().
Ah, I have tried to do custom draw but I don't get it to work, how do I make menu and the other things(mentioned earlier) with custom draw, I could use some samples of code, since I seem to be doing something wrong when I don't get it to work. =) Thanks, /Fredrik