how can i change dialog box color by clicking button

Status
Not open for further replies.

sreenivas003

Member level 1
Joined
Feb 24, 2007
Messages
34
Helped
0
Reputation
0
Reaction score
0
Trophy points
1,286
Visit site
Activity points
1,442
hai..friends

i will change the color of dialog box by using the "SetBkColor" method in InitInstance of app class..


but it works only once....

if i want to change the background color of dialoge frequently by clicking on a Button......

what can i do.....?

plz suggest me friends........
 

Have a static circular buffer in the button event routine containing the colors you want, and step through the array.
 

There was a message from alishirazi63 wrongly posted in report system.


hello, you should handle event on button and write this code: CClientDC dc(this); CRect rect; GetClientRect(rect); dc.FillRect(&rect, &CBrush(RGB(0,0,128)));
 

when you repaint a new colour by setting any entity colour

a message is sent to mainWnd frame message... WM_PAINT
but sometimes this routine is guarded
by a qualifed what it was called to repaint
like whole window . entity , group etc... as you see

so you basicaly need to refresh the whole window after a change
by repainting the whole window each time an event
like a change to its self happens

so its a trip to repost window {simply redraw the whole window class condusive}

if a window itterates with other changes that go in to its accepts
then it will normaly only repaint the entity within the frame
unless a menu choice is then made
but wont repaint what made the actual window frame depending on how your menus are scheduled to redraw there background etc...

unless you asked it to and this happens with only some events or a refresh all open apps within any o/s as does happen on some events

unless its a simple window entity change like a button press in a client area

and this does'nt happen each time you change colour unless you specify a repaint
via any WM CREATE.... unless it repaints the whole frame by recreating it

only if another accept changes the whole frame
like a stretch or refresh hierachie ...change window focus
within windows itself
this causes a global repaint event anyway....
and can be confuced with an ide or apps redraw accepts or self
when a colour is changed and the app looses focus even from a child window
or a global refresh occurs within windows normal schedules

unless you call a recall event within the msg class your ::main will construct

remember windows messages work in tears
MMsg... millions of time events later...
KMsg
Msg.. actual realtime events you choose
mMsg .. miliseconds events used to decide what you do or the ide does...
uMsg .. micro message events {time frame of the event allowed }
nMsg ... nano seconds time windows
pMsg pico message events {picoseconds time allowance }
self explainitary event ladder that keeps windows timed no matter how fast an event happend to the main MSG of your apps function calls
from ide menus choices and realtime YOU

best use a repaint on bkg colour change function
constructed window flag .. etc however the main window
within the container you used is cast and constructed at runtime
 

Status
Not open for further replies.
Cookies are required to use this site. You must accept them to continue using the site. Learn more…