You can code sth in the C**View::OnUpdate()function, using AutoLoad(ID, dlg). The dlg can be (CDialog *) this and the CBitmapButton could be user-draw mode, and you can use LoadBitmaps() to load bitmaps to the buttuon. Got it?
我在WM_CREATE和OnUpdate()里面处理好象都不行啊,能说详细一点吗?
The points are: 1. (CDialog *) this is for the dlg pointer; 2. the button in the dialog should be user-draw mode, and you need add 3 bitmaps to resource; 3. create a member varible as CBitmapButton in the C**View class and map this button to the button created in the dialog.
void CProject1View::OnInitialUpdate() {里加.
Did you write it, guys? I just used this method several days ago.
CBitmapButton myButton;// Create the bitmap button (must include the BS_OWNERDRAW style). myButton.Create(NULL, WS_CHILD|WS_VISIBLE|BS_OWNERDRAW, CRect(10,10,100,100), pParentWnd, 1);// Load the bitmaps for this button. myButton.LoadBitmaps(IDB_UP, IDB_DOWN, IDB_FOCUS, IDB_DISABLE);
1. (CDialog *) this is for the dlg pointer;
2. the button in the dialog should be user-draw mode, and you need add 3 bitmaps to resource;
3. create a member varible as CBitmapButton in the C**View class and map this button to the button created in the dialog.
{里加.
myButton.Create(NULL, WS_CHILD|WS_VISIBLE|BS_OWNERDRAW,
CRect(10,10,100,100), pParentWnd, 1);// Load the bitmaps for this button.
myButton.LoadBitmaps(IDB_UP, IDB_DOWN, IDB_FOCUS, IDB_DISABLE);