Home > Software engineering >  MFC Button in the Button to set the bitmap in the Windows XP system failure
MFC Button in the Button to set the bitmap in the Windows XP system failure

Time:09-24

Set the Button Button bitmap open style, the same to the Button to set the bitmap SetBitmap, feasible in Windows 7, but not feasible in the XP system, I do not know the reason,
 
CBitmap BMP.
BMP. LoadBitmap (IDB_BITMAP1);
CButton * pButton=(CButton *) GetDlgItem (IDC_BUTTON1);
PButton - & gt; ModifyStyle (0, BS_BITMAP);
PButton - & gt; SetBitmap (BMP);

CodePudding user response:

Scope of might be the problem?

The static CBitmap BMP. BMP. DeleteObject ();
BMP. LoadBitmap (IDB_BITMAP1);

CodePudding user response:

BMP to member variables, or global variable

CodePudding user response:

Should be xp does not support it, as this button displays a bitmap needs to be redrawn, such effect is consistent on all machines
  • Related