vendredi 15 juin 2018

MFC/C++: Setting property BS_OWNERDRAW to checkbox button doesn't work

I am trying to change draw context (background color, text color, icon, ...) of checkbox button dynamically, but I have several problems to draw it, because when I try to modify style in PreSubclassWindow callback, the framework doesn't paint the checkbox control.

void CheckBoxButton::PreSubclassWindow()
{
   ModifyStyle(0xf, BS_CHECKBOX);
   ModifyStyle(0, BS_OWNERDRAW);

   CButton::PreSubclassWindow();
}




Aucun commentaire:

Enregistrer un commentaire