Click here to Skip to main content
15,922,407 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
GeneralRe: Simple Assambly inside C code requested. Pin
Michael Hendrickx24-Oct-04 15:31
Michael Hendrickx24-Oct-04 15:31 
Questionhow to know if computer is connected to the internet? Pin
includeh1024-Oct-04 9:11
includeh1024-Oct-04 9:11 
AnswerRe: how to know if computer is connected to the internet? Pin
Michael Dunn24-Oct-04 12:59
sitebuilderMichael Dunn24-Oct-04 12:59 
AnswerRe: how to know if computer is connected to the internet? Pin
ThatsAlok24-Oct-04 22:37
ThatsAlok24-Oct-04 22:37 
QuestionShow dialog in taskbar? Pin
Dominik Reichl24-Oct-04 7:55
Dominik Reichl24-Oct-04 7:55 
AnswerRe: Show dialog in taskbar? Pin
Neville Franks24-Oct-04 10:36
Neville Franks24-Oct-04 10:36 
GeneralGDI+ icon drawing bug. Please help! Pin
Member 139903824-Oct-04 7:32
Member 139903824-Oct-04 7:32 
Generalbackground colors Pin
picasso224-Oct-04 7:26
picasso224-Oct-04 7:26 
I have a dialog box that I am trying to change the background color of the listbox and text fields (CEDIT). This is what I have done so far:
1. In the header, public section,declare a variable (CBrush m_bkColor;)
2. Using wizard, created the WM_CTLCOLOR function
3. funtion looks like this
HBRUSH CMyDialog::OnCtlColor(CDC* pDC, CWnd* pWnd, UINT nCtlColor)
{
HBRUSH hbr = CDialog::OnCtlColor(pDC, pWnd, nCtlColor);

// TODO: Change any attributes of the DC here
switch(nCtlColor)
{

case CTLCOLOR_LISTBOX:
case CTLCOLOR_EDIT:
{


pDC->SetTextColor(RGB(0,0,0));
pDC->SetBkColor(RGB(192,220,192));
return (HBRUSH)(m_bkColor.GetSafeHandle());


}

case CTLCOLOR_BTN:
case CTLCOLOR_STATIC: //text for dialog box

//case CTLCOLOR_DLG: //dialog background color
//return static_cast<hbrush>(m_pBrush->GetSafeHandle());
}


// TODO: Return a different brush if the default is not desired
return hbr;
}

The problem is that only the background of the text is colored, not the entire listbox or text fields.
Any help will be greatly appreciated.
GeneralRe: background colors Pin
picasso224-Oct-04 16:30
picasso224-Oct-04 16:30 
Generalmy program wont quit Pin
Programmer_Chris24-Oct-04 3:26
Programmer_Chris24-Oct-04 3:26 
GeneralRe: my program wont quit Pin
User 665824-Oct-04 3:35
User 665824-Oct-04 3:35 
GeneralRe: my program wont quit Pin
Programmer_Chris24-Oct-04 7:23
Programmer_Chris24-Oct-04 7:23 
Questionfind problem? Pin
Larsson24-Oct-04 2:44
Larsson24-Oct-04 2:44 
QuestionCHM files: open folder? Pin
Dominik Reichl24-Oct-04 2:07
Dominik Reichl24-Oct-04 2:07 
General AfxMessageBox(&quot;Simple message box.&quot;); Pin
Programmer_Chris23-Oct-04 22:36
Programmer_Chris23-Oct-04 22:36 
GeneralRe: AfxMessageBox(&quot;Simple message box.&quot;); Pin
Neville Franks24-Oct-04 0:12
Neville Franks24-Oct-04 0:12 
GeneralRe: AfxMessageBox(&quot;Simple message box.&quot;); Pin
Programmer_Chris24-Oct-04 1:00
Programmer_Chris24-Oct-04 1:00 
GeneralRe: AfxMessageBox(&quot;Simple message box.&quot;); Pin
Neville Franks24-Oct-04 1:55
Neville Franks24-Oct-04 1:55 
GeneralRe Pin
yanping wang24-Oct-04 2:49
yanping wang24-Oct-04 2:49 
GeneralRe: Re Pin
Programmer_Chris24-Oct-04 3:23
Programmer_Chris24-Oct-04 3:23 
GeneralTough time with template syntax Pin
LynnJ23-Oct-04 19:04
LynnJ23-Oct-04 19:04 
GeneralRe: Tough time with template syntax Pin
Bob Stanneveld24-Oct-04 2:19
Bob Stanneveld24-Oct-04 2:19 
GeneralRe: Tough time with template syntax Pin
Andrew Walker24-Oct-04 4:34
Andrew Walker24-Oct-04 4:34 
GeneralRe: Tough time with template syntax Pin
Kevin McFarlane24-Oct-04 5:12
Kevin McFarlane24-Oct-04 5:12 
GeneralRe: Tough time with template syntax Pin
Kevin McFarlane24-Oct-04 5:10
Kevin McFarlane24-Oct-04 5:10 

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.