Click here to Skip to main content
15,895,011 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
QuestionSomewhat advanced C++ question... Pin
CAgent0075-Jan-07 13:33
CAgent0075-Jan-07 13:33 
AnswerRe: Somewhat advanced C++ question... Pin
PJ Arends5-Jan-07 13:46
professionalPJ Arends5-Jan-07 13:46 
GeneralRe: Somewhat advanced C++ question... Pin
CAgent0075-Jan-07 13:54
CAgent0075-Jan-07 13:54 
AnswerRe: Somewhat advanced C++ question... Pin
CoffeeAddict195-Jan-07 14:38
CoffeeAddict195-Jan-07 14:38 
AnswerRe: Somewhat advanced C++ question... Pin
Eytukan5-Jan-07 17:08
Eytukan5-Jan-07 17:08 
GeneralRe: Somewhat advanced C++ question... Pin
CAgent0078-Jan-07 8:13
CAgent0078-Jan-07 8:13 
GeneralRe: Somewhat advanced C++ question... Pin
Eytukan8-Jan-07 19:32
Eytukan8-Jan-07 19:32 
QuestionChanging the color of a pen or brush on the fly? Pin
CoffeeAddict195-Jan-07 10:20
CoffeeAddict195-Jan-07 10:20 
I know how to initialize a brush or pen to a specific color, but I couldn't find any methods for changing the contents of a brush or pen once it has been initialized. In my application the user has to be able to change it, so simply creating a new variable isn't practical. I've been deleting the brush and then re-initializing it with the new color as you can see:

void CGameWin::ChangeBackgroundColor(COLORREF Color)
{
	CurrentBackgroundColor = Color;
	CurrentBackgroundColorBrush.DeleteObject();
	CurrentBackgroundColorBrush.CreateSolidBrush(Color);
	background_DC.SelectObject(CurrentBackgroundColorBrush);
}


Is there a better way to do this?
AnswerRe: Changing the color of a pen or brush on the fly? Pin
Christian Graus5-Jan-07 10:46
protectorChristian Graus5-Jan-07 10:46 
Questiondt_dll sample of windows platform sdk Pin
jfranzoy5-Jan-07 10:09
jfranzoy5-Jan-07 10:09 
AnswerRe: dt_dll sample of windows platform sdk Pin
Dominik Reichl5-Jan-07 11:22
Dominik Reichl5-Jan-07 11:22 
Questionwhats wrong with this code? Pin
arbster5-Jan-07 9:18
arbster5-Jan-07 9:18 
AnswerRe: whats wrong with this code? Pin
Michael Dunn5-Jan-07 9:29
sitebuilderMichael Dunn5-Jan-07 9:29 
AnswerRe: whats wrong with this code? Pin
David Crow5-Jan-07 10:07
David Crow5-Jan-07 10:07 
GeneralRe: whats wrong with this code? Pin
Cristian Amarie5-Jan-07 20:56
Cristian Amarie5-Jan-07 20:56 
GeneralRe: whats wrong with this code? Pin
Stephen Hewitt7-Jan-07 11:48
Stephen Hewitt7-Jan-07 11:48 
GeneralRe: whats wrong with this code? Pin
Cristian Amarie7-Jan-07 20:16
Cristian Amarie7-Jan-07 20:16 
AnswerRe: whats wrong with this code? Pin
Hamid_RT5-Jan-07 18:55
Hamid_RT5-Jan-07 18:55 
QuestionEnabling and Diabling a Control Pin
celllllllll5-Jan-07 8:07
celllllllll5-Jan-07 8:07 
AnswerRe: Enabling and Diabling a Control Pin
Eytukan5-Jan-07 8:19
Eytukan5-Jan-07 8:19 
AnswerRe: Enabling and Diabling a Control Pin
jeron15-Jan-07 8:19
jeron15-Jan-07 8:19 
GeneralRe: Enabling and Diabling a Control Pin
celllllllll5-Jan-07 8:28
celllllllll5-Jan-07 8:28 
GeneralRe: Enabling and Diabling a Control Pin
Eytukan5-Jan-07 8:36
Eytukan5-Jan-07 8:36 
Questionhiding variables Pin
swjam5-Jan-07 7:37
swjam5-Jan-07 7:37 
AnswerRe: hiding variables Pin
Eytukan5-Jan-07 7:52
Eytukan5-Jan-07 7:52 

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.