加了CButtonST之后程序无法运行了
我有一个多文档程序CTestApp,一个登陆界面对话框AdminLogin。
test.cpp
CAdminLogin loginDlg;
if (loginDlg.DoModal()==IDOK)
{
// Register the application's document templates. Document templates
// serve as the connection between documents, frame windows and views.
CMultiDocTemplate* pDocTemplate;
pDocTemplate = new CMultiDocTemplate(
IDR_MAINFRAME,
RUNTIME_CLASS(CTestDoc),
RUNTIME_CLASS(CChildFrame), // custom MDI child frame
RUNTIME_CLASS(CTestView));
AddDocTemplate(pDocTemplate);//使用了CButtonST之后,这句会出错,其中pDocTemplate不为NULL
在项目中导入BCMenu.cpp,BCMenu.h,BtnST.cpp,BtnST.h,并将AdminLogin的按钮都定义成CButtonST:
CButtonST m_OK;
CButtonST m_cancel;
这样在上面的最后一句出错了。将按钮的定义改成CBitmapButton m_OK;CBitmapButton m_cancel;并将导入的四个文件删除掉就好了。这是什么情况?
另外我使用CButtonST主要是想做个透明效果,MFC对话框设计器的按钮的properties->extended styles里有个Transparent属性。按理说是控制透明度的,可是一般选中不选中都没效果。当按钮背后有picture控件作为背景图片的时候,选中就不透明,不选就透明,似乎反了。
说了这么多不知道说清楚了没有。
test.cpp
CAdminLogin loginDlg;
if (loginDlg.DoModal()==IDOK)
{
// Register the application's document templates. Document templates
// serve as the connection between documents, frame windows and views.
CMultiDocTemplate* pDocTemplate;
pDocTemplate = new CMultiDocTemplate(
IDR_MAINFRAME,
RUNTIME_CLASS(CTestDoc),
RUNTIME_CLASS(CChildFrame), // custom MDI child frame
RUNTIME_CLASS(CTestView));
AddDocTemplate(pDocTemplate);//使用了CButtonST之后,这句会出错,其中pDocTemplate不为NULL
在项目中导入BCMenu.cpp,BCMenu.h,BtnST.cpp,BtnST.h,并将AdminLogin的按钮都定义成CButtonST:
CButtonST m_OK;
CButtonST m_cancel;
这样在上面的最后一句出错了。将按钮的定义改成CBitmapButton m_OK;CBitmapButton m_cancel;并将导入的四个文件删除掉就好了。这是什么情况?
另外我使用CButtonST主要是想做个透明效果,MFC对话框设计器的按钮的properties->extended styles里有个Transparent属性。按理说是控制透明度的,可是一般选中不选中都没效果。当按钮背后有picture控件作为背景图片的时候,选中就不透明,不选就透明,似乎反了。
说了这么多不知道说清楚了没有。
...全文
相关推荐
CButtonST文件
内含BtnSt.h BtnSt.cpp BCMenu.cpp BCMenu.h四个文件
VS2010下CButtonST类
该CButtonST类经过修改之后现已可以在VS2010下使用,使用方法已经在文件中说明。此类可以轻松实现按钮修改,完成更加美观强大的按钮。
CButtonST cbuttonst CButtonST_demo CButtonST_Source 控件
CButtonST使我目前见过的最强大,功能最全的CButton派生类。撰写本文的目的不在于技术的讨论,而是希望能够为各位提供关于CButtonST的使用参考,以提高编写程序的速度。CButtonST使我目前见过的最强大,功能最全的CButton派生类。撰写本文的目的不在于技术的讨论,而是希望能够为各位提供关于CButtonST的使用参考,以提高编写程序的速度
CButtonST和CMenu类
基于MFC的CButtonST类和CMenu类,可对界面上 的按钮进行美化设计
VC2015及2017下可以使用的CButtonST
本人亲测,VC2015及2017下可以使用的CButtonST 这里发布的是源码,直接编译即可使用


界面
