Click here to Skip to main content
14,920,872 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
GeneralRe: Is there an equivalent to SuspendLayout/ResumeLayout for a MFC Dialog ? Pin
Mark Salsbery6-Sep-07 8:27
MemberMark Salsbery6-Sep-07 8:27 
GeneralRe: Is there an equivalent to SuspendLayout/ResumeLayout for a MFC Dialog ? [modified] Pin
abiemann6-Sep-07 8:33
Memberabiemann6-Sep-07 8:33 
QuestionRe: Is there an equivalent to SuspendLayout/ResumeLayout for a MFC Dialog ? Pin
David Crow6-Sep-07 8:41
MemberDavid Crow6-Sep-07 8:41 
AnswerRe: Is there an equivalent to SuspendLayout/ResumeLayout for a MFC Dialog ? Pin
abiemann6-Sep-07 8:52
Memberabiemann6-Sep-07 8:52 
QuestionRe: Is there an equivalent to SuspendLayout/ResumeLayout for a MFC Dialog ? Pin
David Crow6-Sep-07 8:56
MemberDavid Crow6-Sep-07 8:56 
AnswerRe: Is there an equivalent to SuspendLayout/ResumeLayout for a MFC Dialog ? Pin
abiemann6-Sep-07 9:00
Memberabiemann6-Sep-07 9:00 
GeneralRe: Is there an equivalent to SuspendLayout/ResumeLayout for a MFC Dialog ? Pin
David Crow6-Sep-07 10:20
MemberDavid Crow6-Sep-07 10:20 
GeneralRe: Is there an equivalent to SuspendLayout/ResumeLayout for a MFC Dialog ? [modified] Pin
abiemann6-Sep-07 13:08
Memberabiemann6-Sep-07 13:08 
Hi David,

I've made the change and the background bitmap doesn't flicker at all, however, the controls ontop of the bitmap still flicker.

This is the change I've made:

KeyHandler now triggers OnEraseBkgnd instead of performing PatBlt
When the user presses a key, the key's number is stored in a private member variable of the Dialog.
To subsequently make it update the background image, the Dialogs' key handler performs :
this->Invalidate(TRUE);<br />
this->UpdateWindow();


OnEraseBkgnd now does the PatBlt of the static image behind the controls
Next, OnEraseBkgnd(CDC* pDC) is processed.
this handler first checks that a key was pressed, if so, it performs the targetDC.PatBlt (I just use the pDC that's passed in) then it returns TRUE.
If no key was pressed then I let this handler perform the default CDialog::OnEraseBkgnd(pDC)


After this change I noticed that the individual controls no longer need their RedrawWindow() called, however, they still flicker (but the background static image doesn't flicker at all now).
I've also removed the SetRedraw() calls



-- modified at 19:14 Thursday 6th September, 2007
GeneralRe: Is there an equivalent to SuspendLayout/ResumeLayout for a MFC Dialog ? Pin
Mark Salsbery6-Sep-07 14:31
MemberMark Salsbery6-Sep-07 14:31 
GeneralRe: Is there an equivalent to SuspendLayout/ResumeLayout for a MFC Dialog ? Pin
David Crow6-Sep-07 17:30
MemberDavid Crow6-Sep-07 17:30 
QuestionRe: Is there an equivalent to SuspendLayout/ResumeLayout for a MFC Dialog ? Pin
Hamid_RT6-Sep-07 7:33
MemberHamid_RT6-Sep-07 7:33 
AnswerRe: Is there an equivalent to SuspendLayout/ResumeLayout for a MFC Dialog ? Pin
abiemann6-Sep-07 7:39
Memberabiemann6-Sep-07 7:39 
AnswerRe: Is there an equivalent to SuspendLayout/ResumeLayout for a MFC Dialog ? Pin
Waldermort6-Sep-07 9:31
MemberWaldermort6-Sep-07 9:31 
GeneralRe: Is there an equivalent to SuspendLayout/ResumeLayout for a MFC Dialog ? Pin
Mark Salsbery6-Sep-07 9:45
MemberMark Salsbery6-Sep-07 9:45 
GeneralRe: Is there an equivalent to SuspendLayout/ResumeLayout for a MFC Dialog ? Pin
abiemann7-Sep-07 11:03
Memberabiemann7-Sep-07 11:03 
QuestionInfinity Symbol Pin
paper676-Sep-07 6:05
Memberpaper676-Sep-07 6:05 
AnswerRe: Infinity Symbol Pin
Mark Salsbery6-Sep-07 6:35
MemberMark Salsbery6-Sep-07 6:35 
AnswerRe: Infinity Symbol Pin
Matthew Faithfull6-Sep-07 6:40
MemberMatthew Faithfull6-Sep-07 6:40 
QuestionLooking for a &quot;Thumb Wheel&quot; control [modified] Pin
bscaer6-Sep-07 4:26
Memberbscaer6-Sep-07 4:26 
AnswerRe: Looking for a "Thumb Wheel" control Pin
led mike6-Sep-07 5:25
Memberled mike6-Sep-07 5:25 
JokeRe: Looking for a "Thumb Wheel" control Pin
Cedric Moonen6-Sep-07 7:21
MemberCedric Moonen6-Sep-07 7:21 
AnswerRe: Looking for a &quot;Thumb Wheel&quot; control Pin
Hamid_RT6-Sep-07 7:39
MemberHamid_RT6-Sep-07 7:39 
AnswerRe: Looking for a &quot;Thumb Wheel&quot; control Pin
Waldermort6-Sep-07 9:27
MemberWaldermort6-Sep-07 9:27 
AnswerRe: Looking for a &quot;Thumb Wheel&quot; control Pin
Sreedhar DV7-Sep-07 1:13
MemberSreedhar DV7-Sep-07 1:13 
QuestionCreateWindowEx fails Pin
GauranG Shah6-Sep-07 4:02
MemberGauranG Shah6-Sep-07 4:02 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.