Click here to Skip to main content
16,005,120 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
QuestionHow do you know if a control is clicked Pin
JekYu30-Aug-01 14:44
JekYu30-Aug-01 14:44 
AnswerRe: How do you know if a control is clicked Pin
Alex Taylor30-Aug-01 14:56
Alex Taylor30-Aug-01 14:56 
GeneralChange color of the Form Pin
JekYu30-Aug-01 14:03
JekYu30-Aug-01 14:03 
GeneralRe: Change color of the Form Pin
Alex Taylor30-Aug-01 14:51
Alex Taylor30-Aug-01 14:51 
GeneralRe: Change color of the Form Pin
JekYu30-Aug-01 15:02
JekYu30-Aug-01 15:02 
GeneralRe: Change color of the Form Pin
Alex Taylor30-Aug-01 15:12
Alex Taylor30-Aug-01 15:12 
GeneralRe: Change color of the Form Pin
JekYu30-Aug-01 20:06
JekYu30-Aug-01 20:06 
GeneralRe: Change color of the Form Pin
Richard Stringer31-Aug-01 12:31
Richard Stringer31-Aug-01 12:31 
Erasebackground will not completly solve your problem nor do I think it is the prefered method. Usesomething like this:

void CMainView::OnPaint()
{
CMainFrame* pFrame;
CPaintDC dc(this); // device context for painting
pFrame = (CMainFrame*)GetParentFrame();
CString s="Printing Library Demo Program";
pFrame->SetWindowText(s);


RECT rc;
CBrush cBr(RGB(255,255,0));
GetClientRect(&rc);
dc.FillRect(&rc, &cBr);

}

then to solve the control background problem use this:

HBRUSH CMainView::OnCtlColor(CDC* pDC, CWnd* pWnd, UINT nCtlColor)
{
HBRUSH hbr = CFormView::OnCtlColor(pDC, pWnd, nCtlColor);

if(nCtlColor==CTLCOLOR_STATIC)
{
HBRUSH hbr2=CreateSolidBrush(RGB(255,255,0));
pDC->SetBkMode(TRANSPARENT);
return hbr2;
}
return hbr;
}

Class wizard will make both overrides for you


Richard
ISS Software
Dallas Texas
GeneralRelease build. Pin
John Uhlenbrock30-Aug-01 14:03
John Uhlenbrock30-Aug-01 14:03 
GeneralRe: Release build. Pin
Tomasz Sowinski30-Aug-01 23:23
Tomasz Sowinski30-Aug-01 23:23 
GeneralRe: Release build. Pin
John Uhlenbrock31-Aug-01 10:30
John Uhlenbrock31-Aug-01 10:30 
GeneralRe: Release build. Pin
Mukkie31-Aug-01 6:11
Mukkie31-Aug-01 6:11 
GeneralRe: Release build. Pin
John Uhlenbrock4-Sep-01 4:57
John Uhlenbrock4-Sep-01 4:57 
GeneralRe: Release build. Pin
Tim Deveaux31-Aug-01 8:15
Tim Deveaux31-Aug-01 8:15 
GeneralRe: Release build. Pin
John Uhlenbrock4-Sep-01 4:59
John Uhlenbrock4-Sep-01 4:59 
GeneralRe: All. Pin
John Uhlenbrock31-Aug-01 10:45
John Uhlenbrock31-Aug-01 10:45 
GeneralRe: All. Pin
Tim Deveaux31-Aug-01 14:33
Tim Deveaux31-Aug-01 14:33 
GeneralRe: All. Pin
John Uhlenbrock4-Sep-01 4:50
John Uhlenbrock4-Sep-01 4:50 
GeneralRe: All. Pin
Tim Deveaux4-Sep-01 13:40
Tim Deveaux4-Sep-01 13:40 
GeneralRe: All, solution...fix...whatever. Pin
John Uhlenbrock4-Sep-01 13:46
John Uhlenbrock4-Sep-01 13:46 
GeneralRe: All, solution...fix...whatever. Pin
Tim Deveaux4-Sep-01 14:03
Tim Deveaux4-Sep-01 14:03 
GeneralMultiple Document Extensions Pin
Frank Deo30-Aug-01 13:49
Frank Deo30-Aug-01 13:49 
GeneralRe: Multiple Document Extensions Pin
Ben Burnett30-Aug-01 15:04
Ben Burnett30-Aug-01 15:04 
GeneralRe: Multiple Document Extensions Pin
Frank Deo30-Aug-01 15:53
Frank Deo30-Aug-01 15:53 
Questioncreating/changing icons? Pin
30-Aug-01 12:19
suss30-Aug-01 12:19 

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.