Click here to Skip to main content
15,888,351 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
GeneralRe: MFC CreateCompatibleDC(), Drawtext() no display Pin
econy17-Mar-14 5:06
econy17-Mar-14 5:06 
GeneralRe: MFC CreateCompatibleDC(), Drawtext() no display Pin
econy17-Mar-14 5:19
econy17-Mar-14 5:19 
GeneralRe: MFC CreateCompatibleDC(), Drawtext() no display Pin
Chris Losinger17-Mar-14 5:34
professionalChris Losinger17-Mar-14 5:34 
GeneralRe: MFC CreateCompatibleDC(), Drawtext() no display Pin
econy17-Mar-14 16:11
econy17-Mar-14 16:11 
GeneralRe: MFC CreateCompatibleDC(), Drawtext() no display Pin
Chris Losinger18-Mar-14 1:41
professionalChris Losinger18-Mar-14 1:41 
GeneralRe: MFC CreateCompatibleDC(), Drawtext() no display Pin
Chris Losinger18-Mar-14 1:44
professionalChris Losinger18-Mar-14 1:44 
GeneralRe: MFC CreateCompatibleDC(), Drawtext() no display Pin
econy18-Mar-14 2:26
econy18-Mar-14 2:26 
QuestionMFC set Control color question [Solved] Pin
econy16-Mar-14 11:13
econy16-Mar-14 11:13 
Hi, I want to change a control's color, for example, static text.

logic like:
if test == 0 then 
   static text color = Red
else 
   static text color = Green
endif

first I try to do it in OnCtlColor() function, in timer function,
I declared a global variable.
<pre lang="text">
BOOL test = 0;
OnTimer() {
 test ^= 1;
}

OnCtlColor() {
 if (test == 0 ) {
     pDC->SetTextColor(RGB(0,100,0));
  }
  else {
	pDC->SetTextColor(RGB(255,0,0));
	//pDC->SetBkMode(TRANSPARENT);
  }
}

But, the color always be green, not swap.
I knew OnCtlColor need to be trigger with invalidate().

but I don't know how to invalidate a control, not affect it's parent window.

modified 17-Mar-14 7:59am.

AnswerRe: MFC set Control color question Pin
CPallini16-Mar-14 22:29
mveCPallini16-Mar-14 22:29 
GeneralRe: MFC set Control color question Pin
econy17-Mar-14 1:58
econy17-Mar-14 1:58 
GeneralRe: MFC set Control color question Pin
CPallini17-Mar-14 2:52
mveCPallini17-Mar-14 2:52 
QuestionCompiling DLL - what is the sequence of compilation? SOLVED Pin
Vaclav_16-Mar-14 8:53
Vaclav_16-Mar-14 8:53 
AnswerRe: Compiling DLL - what is the sequence of compilation? Pin
Richard MacCutchan16-Mar-14 23:11
mveRichard MacCutchan16-Mar-14 23:11 
GeneralRe: Compiling DLL - what is the sequence of compilation? Pin
Vaclav_17-Mar-14 3:47
Vaclav_17-Mar-14 3:47 
GeneralRe: Compiling DLL - what is the sequence of compilation? Pin
Gisle Vanem17-Mar-14 4:00
Gisle Vanem17-Mar-14 4:00 
GeneralRe: Compiling DLL - what is the sequence of compilation? Pin
Richard MacCutchan17-Mar-14 4:16
mveRichard MacCutchan17-Mar-14 4:16 
GeneralRe: Compiling DLL - what is the sequence of compilation? Pin
Vaclav_17-Mar-14 7:42
Vaclav_17-Mar-14 7:42 
GeneralRe: Compiling DLL - what is the sequence of compilation? Pin
Richard MacCutchan17-Mar-14 7:54
mveRichard MacCutchan17-Mar-14 7:54 
QuestionDrawText() blinking problem Pin
econy15-Mar-14 1:36
econy15-Mar-14 1:36 
AnswerRe: DrawText() blinking problem Pin
PJ Arends15-Mar-14 6:07
professionalPJ Arends15-Mar-14 6:07 
GeneralRe: DrawText() blinking problem Pin
econy15-Mar-14 6:33
econy15-Mar-14 6:33 
AnswerRe: DrawText() blinking problem Pin
Richard MacCutchan15-Mar-14 6:39
mveRichard MacCutchan15-Mar-14 6:39 
GeneralRe: DrawText() blinking problem Pin
econy15-Mar-14 6:44
econy15-Mar-14 6:44 
GeneralRe: DrawText() blinking problem Pin
Richard MacCutchan15-Mar-14 6:54
mveRichard MacCutchan15-Mar-14 6:54 
GeneralRe: DrawText() blinking problem Pin
econy15-Mar-14 6:54
econy15-Mar-14 6:54 

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.