先在.h中定义 :CBitmapButton m_Calling;然后在:DoDataExchange(CDataExchange* pDX)中
        DDX_Control(pDX, IDC_BNT_MAKECALL, m_Calling);关联到Button然后在
OnInitDialog() 中 m_Calling.LoadBitmaps (IDR_JPG1); 
IDR_JPG1为一张导入的JPG图片。结果Button显示为空白,什么都不显示,请问怎么回事?

解决方案 »

  1.   

    LoadBitmaps只支持位图文件,不支持JPG。同时该按钮属性应该设置为OWNER_DRAW
      

  2.   

    改成 bmp文件了,按钮属性设置为OWNER_DRAW,早就设置了,可是还是不行哦,现在 回去这个button时出现错误 :Program F:\xx\xx.exe
    File:f:\dd\vctools\vc7libs\ship\atlmfc\src\wincore.cpp (我电脑中无此目录及文件)
    line:379for information on how your grogram can cause an assertion failure,see the Visual C++ documentation on asserts.               中止,重试,忽略 (三个Button)
      

  3.   

    CBitmapButton使用需要注意一些问题的CBitmapButton的使用
      

  4.   

    你要用4张图片作为资源Load进来
      

  5.   

    // Load the bitmaps for this button.
    pmyButton->LoadBitmaps(IDB_UP, IDB_DOWN, IDB_FOCUS, IDB_DISABLE); // Resize the button to be the size of the bitmaps.
    pmyButton->SizeToContent();
      

  6.   


    m_Calling.SizeToContent (); 这一行又出现 Debug Assertion failed! 错误。Program F:\xx\xx.exe
    File:f:\dd\vctools\vc7libs\ship\atlmfc\src\wincore.cpp (我电脑中无此目录及文件)
    line:379for information on how your grogram can cause an assertion failure,see the Visual C++ documentation on asserts.               中止,重试,忽略 (三个Button)
      

  7.   

    to hurryboylqs 控件关联好了,ID 没有写错啊。可以加下QQ么?三一一9333 谢谢!
      

  8.   

    第一次选库的时候就把CBitmapButton给排除了,毅然选择了CButtonST。例子呈现效果差距太大。