반응형
// BitmapButton2.h
class CBitmapButton2Dlg : public CDialog
{
// Construction
public:
CBitmapButton2Dlg(CWnd* pParent = NULL); // standard constructor
CBitmap m_bmpOk;
CBitmap m_bmpCancel;
// Dialog Data
//{{AFX_DATA(CBitmapButton2Dlg)
enum { IDD = IDD_BITMAPBUTTON2_DIALOG };
CButton m_ctrlCancel;
CButton m_ctrlOK;
// NOTE: the ClassWizard will add data members here
//}}AFX_DATA
//...
}
// BitmapButton2.cpp
void CBitmapButton2Dlg::DoDataExchange(CDataExchange* pDX)
{
CDialog::DoDataExchange(pDX);
//{{AFX_DATA_MAP(CBitmapButton2Dlg)
DDX_Control(pDX, IDCANCEL, m_ctrlCancel);
DDX_Control(pDX, IDOK, m_ctrlOK);
//}}AFX_DATA_MAP
}
BOOL CBitmapButton2Dlg::OnInitDialog()
{
CDialog::OnInitDialog();
SetIcon(m_hIcon, TRUE); // Set big icon
SetIcon(m_hIcon, FALSE); // Set small icon
m_bmpOk.LoadBitmap(IDB_OK);
m_bmpCancel.LoadBitmap(IDB_CANCEL);
m_ctrlOK.SetBitmap(m_bmpOk);
m_ctrlCancel.SetBitmap(m_bmpCancel);
return TRUE; // return TRUE unless you set the focus to a control
}
반응형
'C & C++ > MFC 컨트롤' 카테고리의 다른 글
[Edit] 숫자 문자 유효성 검사 (0) | 2011.05.21 |
---|---|
[List] Bitmap List (0) | 2011.05.21 |
[Button] Bitmap Button 01 (0) | 2011.05.21 |
[ToolTip] 정적툴팁 (0) | 2011.05.21 |
[ToolTip] 동적 툴팁 (0) | 2011.05.21 |
댓글