Click here to Skip to main content
15,911,039 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
AnswerRe: DialogBox Pin
Michael Schubert17-Aug-09 3:07
Michael Schubert17-Aug-09 3:07 
AnswerRe: DialogBox Pin
KarstenK17-Aug-09 3:48
mveKarstenK17-Aug-09 3:48 
QuestionMessage Closed Pin
16-Aug-09 21:21
coopoll16-Aug-09 21:21 
AnswerBlatant advertisement! Pin
Rajesh R Subramanian16-Aug-09 22:11
professionalRajesh R Subramanian16-Aug-09 22:11 
Questiondraw Visualization in custom directshow mp3 player Pin
raj157616-Aug-09 20:18
raj157616-Aug-09 20:18 
AnswerRe: draw Visualization in custom directshow mp3 player Pin
zhu_lin17-Aug-09 14:47
zhu_lin17-Aug-09 14:47 
GeneralRe: draw Visualization in custom directshow mp3 player Pin
raj157617-Aug-09 20:23
raj157617-Aug-09 20:23 
QuestionChange CFrameWnd background color Pin
Tran Vu Quan16-Aug-09 18:41
Tran Vu Quan16-Aug-09 18:41 
I have a SDI project. I try to change the background colors of both its View and Frame.

For the View, i try :

CMyView::CmainframeView()
{
    // CBrush m_brush is a member of CMyView class
m_brush.CreateSolidBrush(RGB(100, 255, 100));
}

BOOL CMyView::OnEraseBkgnd(CDC* pDC)
{
return TRUE;
}

void CMyView::OnDraw(CDC* pDC)
{
   pDC->SelectObject(&m_brush);
   CRect rect;
   pDC->GetClipBox(&rect);
   pDC->PatBlt(rect.left, rect.top, rect.Width(), rect.Height(), PATCOPY);
}


and it works really well ! But when i try to change background color of CMyFrame :

int CMyFrame::OnCreate(LPCREATESTRUCT lpCreateStruct)
{
  //CBrush m_brush is a member of CMyFrame
  m_brush.CreateSolidBrush(RGB(255, 0, 100));
}

BOOL CMyFrame::OnEraseBkgnd(CDC* pDC)
{
    return TRUE;
}

void CMyFrame::OnPaint()
{
    CPaintDC pDC(this); // device context for painting

    pDC.SelectObject(&m_brush);

    CRect rect;
    pDC.GetClipBox(&rect);
    pDC.Rectangle(rect);
    pDC.PatBlt(rect.left, rect.top, rect.Width(), rect.Height(), PATCOPY);
}


the background color only changes when the window is resize, but it flirt. I also try to hande WM_SIZE message but it doesn't help. Can you give me some suggestions ?
AnswerRe: Change CFrameWnd background color Pin
«_Superman_»16-Aug-09 19:45
professional«_Superman_»16-Aug-09 19:45 
QuestionCDateTimeCtrl in MFC - How to Use? Pin
Larry Mills Sr16-Aug-09 14:59
Larry Mills Sr16-Aug-09 14:59 
AnswerRe: CDateTimeCtrl in MFC - How to Use? Pin
David Crow17-Aug-09 3:14
David Crow17-Aug-09 3:14 
GeneralRe: CDateTimeCtrl in MFC - How to Use? Pin
Larry Mills Sr17-Aug-09 4:19
Larry Mills Sr17-Aug-09 4:19 
GeneralRe: CDateTimeCtrl in MFC - How to Use? Pin
David Crow17-Aug-09 4:25
David Crow17-Aug-09 4:25 
GeneralRe: CDateTimeCtrl in MFC - How to Use? Pin
Larry Mills Sr19-Aug-09 8:07
Larry Mills Sr19-Aug-09 8:07 
QuestionRe: CDateTimeCtrl in MFC - How to Use? Pin
David Crow19-Aug-09 8:29
David Crow19-Aug-09 8:29 
AnswerRe: CDateTimeCtrl in MFC - How to Use? Pin
Larry Mills Sr19-Aug-09 10:26
Larry Mills Sr19-Aug-09 10:26 
GeneralRe: CDateTimeCtrl in MFC - How to Use? Pin
David Crow19-Aug-09 10:30
David Crow19-Aug-09 10:30 
QuestionUse a map as a source of data Pin
Waldemar Ork16-Aug-09 3:18
Waldemar Ork16-Aug-09 3:18 
AnswerRe: Use a map as a source of data Pin
«_Superman_»16-Aug-09 19:19
professional«_Superman_»16-Aug-09 19:19 
GeneralRe: Use a map as a source of data Pin
Waldemar Ork17-Aug-09 5:53
Waldemar Ork17-Aug-09 5:53 
Question╠ How get video card memory size ? ╣ Pin
bzsolt9116-Aug-09 2:21
bzsolt9116-Aug-09 2:21 
AnswerRe: ╠ How get video card memory size ? ╣ Pin
Hristo-Bojilov16-Aug-09 7:45
Hristo-Bojilov16-Aug-09 7:45 
AnswerRe: ╠ How get video card memory size ? ╣ Pin
kilt17-Aug-09 3:06
kilt17-Aug-09 3:06 
AnswerRe: ╠ How get video card memory size ? ╣ Pin
bzsolt9123-Aug-09 4:29
bzsolt9123-Aug-09 4:29 
QuestionHow to cause a CPropertySheet to show a particular page .. [SOLVED] Pin
Ahmed Charfeddine16-Aug-09 1:12
Ahmed Charfeddine16-Aug-09 1:12 

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.