I have a Custom CButton which loads a bitmap, using CButton::SetBitmap(bitmap);
Meanwhile, I want to display a text above the bitmap, on the same button.
I tried implementing OnPaint(), but it does not display the text, just the bitmap
void CBitmapToggleButton::OnPaint()
{
CButton::OnPaint();
CPaintDC dc(this); // device context for painting
CString caption(_T("test message"));
GetWindowText(caption);
CRect rect;
GetWindowRect(&rect);
dc.DrawText(caption, &rect, DT_CENTER);
}
What can I do to display the text too?