CBitmapButton类的使用

  1. 说明:
    • class CBitmapButton : public CButton.
    • CBitmapButton objects contain up to four bitmaps, which contain images for the different states a button can assume: up (or normal), down (or selected), focused, and disabled. Only the first bitmap is required; the others are optional.(摘自msdn)
  2. for dialog:
    • 在dialog中添加button控件,设置owner-draw属性
    • 设置button caption为"$$$",ID为IDC_$$$
    • 添加四张button图片(对应四种状态),设置ID为"$$$U" "$$$D" "$$$F" "$$$X" (注意加"")
    • 在dialog类中添加CbitmapButton成员变量m_bmpBtn
    • 在OnInitDialog中调用: m_bmpBtn.AutoLoad(IDC_$$$,this)
    • OK!
    • 注:由于在AutoLoad中会关联CbitmapButton类和button,所以无需DDX_Control进行关联,否则会出错!
    • 
原文地址:https://www.cnblogs.com/dahai/p/2095001.html