VC高手请进。VC中透明浮动按钮的问题!(急)

dsfy dsfy 墨衍会员 · AI 创作全网分发 墨衍智能分发 通过墨衍一键同步至各平台 可同步平台 CSDN微信公众号微博知乎掘金百家号博客园抖音小红书 你的文章也可以这样分发 墨衍会员 ¥399起/年,写一次发全网 我也要 + 加入社区
我从CButton 派生了一个类CDrawButton来实现对话框上的透明浮动按钮
class CDrawButton : public CButton
{
// Construction
public:
CDrawButton();

private:
CFont* m_pFont;
CBitmap* m_pBmp;
UINT mBtnStats;


public:
virtual ~CDrawButton();
void SetButtonMode(UINT action, UINT mode);
void Draw(CWnd *pParent);
BOOL Load(UINT nID, CWnd *pParent);
// Generated message map functions
protected:
//{{AFX_MSG(CDrawButton)
afx_msg void OnMouseMove(UINT nFlags, CPoint point);
afx_msg void OnLButtonUp(UINT nFlags, CPoint point);
//}}AFX_MSG

DECLARE_MESSAGE_MAP()
};

其中: Load如下:
BOOL CDrawButton::Load(UINT nID, CWnd *pParent)
{
if (m_pBmp!=0)
return FALSE;

if (!SubclassDlgItem(nID, pParent))
return FALSE;

Draw(pParent);

return TRUE;
}

在对话框中添加了OnMouseMove函数来初始化
void CEgDlg::OnMouseMove(UINT nFlags, CPoint point)
{
// TODO: Add your message handler code here and/or call default
m_Button.Load(IDC_SET,this);
CDialog::OnMouseMove(nFlags, point);
}
上面的OnMouseMove只能初始化一个按钮,也就是说Load只能运行一次,
我的问题就是:我的对话框上的按钮有多个,怎样来初始化其它的按钮
...全文

相关推荐

评论 1
收藏 已收藏
分享
返回顶部
dsfy
VC/MFC 16,551 成员 421,605 内容