Click here to Skip to main content
15,890,932 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
 if (PathFileExists(str_path))
 {
     m_Btn1.ShowWindow(SW_SHOW);
     m_Btn1.ModifyStyle(0, BS_BITMAP);

 }

else
  {
     m_Btn1.ModifyStyle(0, BS_OWNERDRAW);
     m_Btn1.Set_Art(m_pArt, 0);
     m_Btn1.ShowWindow(SW_SHOW);
  }


in the first 'if' I would like to set owner draw to false..but I don't know how I can do

What I have tried:

I tried to search on internet, but I don't find
Posted

1 solution

Something like this should do it.
C++
m_Btn1.ModifyStyle(0, BS_BITMAP);
UINT style = m_Btn1.GetButtonStyle();
style &= ~BS_OWNERDRAW;  // mask with all bits except owner draw
m_Btn1.SetButtonStyle(style);
 
Share this answer
 
Comments
Member 14594285 23-Apr-24 4:32am    
thanks very much
Richard MacCutchan 23-Apr-24 6:05am    
You are welcome.

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900