tags:

views:

37

answers:

1

Hi,

I want to display on my dialog, a bitmap button. I am using the below code

CImage image;
hr = image.Load(_T("myimage.png")); // just change extension to load jpg
bitmap.Attach(image.Detach());
m_button.ModifyStyle(0,BS_BITMAP);
m_button.SetBitmap(bitmap);

This way bitmap is correctly displayed on button, but the button is not displayed in 3D style as normal buttons would look. I have set owner drawn property to false, still it displaying like this. Any ideas as to what could be wrong?

Thanks, Rohit

A: 
  • What is the type of m_button
  • Are you initializing the visual style manager correctly if you're using CMFCButton
  • Have you set the correct style of the button in the resource editor (3d)
  • If you're creating the button at runtime, post your Create() call
Roel