MFC CButtonST类解决办法
MFC CButtonST类
然后
一切都好,编译通过没有错误,点击运行

这个怎么回事啊?
还有m_btn.SetIcon(IDR_MAINFRAME);这啥意思,难道设置背景色都要先设置光标吗?
------解决方案--------------------
DoDataExchange函数里面有控件变量绑定就行了,不用SubclassDlgItem吧?SetIcon是设置按钮上的图标的,可以不设置。
CButtonST m_btn;初始化控件变量
然后
BOOL CMy984Dlg::OnInitDialog()
{
CDialog::OnInitDialog();
// Set the icon for this dialog. The framework does this automatically
// when the application's main window is not a dialog
SetIcon(m_hIcon, TRUE); // Set big icon
SetIcon(m_hIcon, FALSE); // Set small icon
// TODO: Add extra initialization here
m_btn.SubclassDlgItem(IDC_BUTTON1,this);
m_btn.SetIcon(IDR_MAINFRAME);
m_btn.SetColor(CButtonST::BTNST_COLOR_BK_OUT, RGB(208,208,208));
m_btn.SetColor(CButtonST::BTNST_COLOR_BK_FOCUS, RGB(208,208,208));
m_btn.OffsetColor(CButtonST::BTNST_COLOR_BK_IN, 30);
return TRUE; // return TRUE unless you set the focus to a control
}
一切都好,编译通过没有错误,点击运行
这个怎么回事啊?
还有m_btn.SetIcon(IDR_MAINFRAME);这啥意思,难道设置背景色都要先设置光标吗?
------解决方案--------------------
DoDataExchange函数里面有控件变量绑定就行了,不用SubclassDlgItem吧?SetIcon是设置按钮上的图标的,可以不设置。