| |||||||||
![]() |
|
|
«
Previous Thread
|
Next Thread
»
|
Thread Tools | Search this Thread | Display Modes |
|
#1
|
|||
|
|||
|
some GDI questions...
I use Visual Studio 6.0 compiler, project - MFC dialog based.
I want to change the bg color of the window, when button1 is pressed - the bg color changes to white, when button2 - to black. What I did is creating CBrush black,white; RECT r; then initializing them GetClientRect(&r); white.CreateSolidBrush(RGB(255,255,255)); black.CreateSolidBrush(RGB(0,0,0)); and functions: void OnButton1() { CPaintDC dc(this); dc.FillRect(&r,&white); } void OnButton2() { CPaintDC dc(this); dc.FillRect(&r,&black); } When button1 is pressed, the bg does change to white, but if button2 is pressed, the color remains white still... ...and vice versa...I don't get it... can anyone help me and explain what is wrong..? |
|
#2
|
|||
|
|||
|
I am able to change colors on both but only while debugging.
When I make an exe of it, the color does not chage on clicking. I am too wondering for a way. |
![]() |
| Viewing: Dev Articles Community Forums > Programming > C/C++ Help > some GDI questions... |
| Thread Tools | Search this Thread |
| Display Modes | Rate This Thread |
|
|
|
|