当前位置:编程学习 > C/C++ >>

如何在FORMVIEW中生成CBitmpButton 按钮

 

 

  在CFormView 中产生CBitmapButtom:

        例如要生成一个OPEN和一个SAVE的CBitmapButtom,可按如下方法:

 

          class CMainWindow : public CFrameWnd

          {

                private:

                    CBitmapButtom m_OpenButtom;

                    CBitmapButtom m_SaveButtom;

                    CBitmapButtom m_SaveButtom;

                public:

                        ......

          };

 

          int CMainWindow : OnCreate(LPREATESTRUCT)

          {

                CRect rect;

                rect.SetRect(4,4,36.36);

                m_OpenButtom.Create(NULL, WS_CHILD | WS_VISIBLE |

BS_OWNERDRAW,

                               rect, this, IDB_OPEN);

                m_OpenBittom.LoadBitmap("OPENU","OPEND");

 

                // m_SaveButtom 如上

 

                。。。。。。。

                return 0;

          }

 

                ......

 

          BEGING_MESSAGE_MAP(CMainWindow, CFromView)

                 .

 

                ......

 

          BEGING_MESSAGE_MAP(CMainWindow, CFromView)

                 .

              ON_BN_CLICKED (IDB_OPEN, OnOpen)

                 .

                 .

          END_MESSAGE_MAP()

 

        //如果以上方法不行请检查你的BITMAP 资源,APPSTUDIO中,"OPENU"和

    &nbs

补充:软件开发 , C语言 ,
CopyRight © 2022 站长资源库 编程知识问答 zzzyk.com All Rights Reserved
部分文章来自网络,