CButtonをサブクラス化する際に、ボタンが押されるたびにボタンの色を増やしたいと思います。しかし、以下は背景色には何もしていません。ただし、テキストにはインクリメントする「c」が表示されます。どうも
void CMyButton::OnLButtonDown(UINT nFlags, CPoint point)
{
CButton::OnLButtonDown(nFlags, point);
static int c;
CString s;
s.Format("left: %d", c*50);
this->SetWindowText(s);
////// Neither of the following change the background color
//CPaintDC dc(this);
//dc.SetBkColor(0x0 + c*50);
CDC *dc= GetDC();
dc->SetBkColor(0x0 + c*50);
c++;
}