我看书上说,CBitmapButton连接资源的时候要在映射对话框的WM_INITDIALOG消息中来调用AutoLoad(ID,dlg),可是CFormView中没有WM_INITDIALOG,应该怎么办?

解决方案 »

  1.   

    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?
      

  2.   

    我在WM_CREATE和OnUpdate()里面处理好象都不行啊,能说详细一点吗?
      

  3.   

    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.
      

  4.   

    void CProject1View::OnInitialUpdate() 
    {里加.
      

  5.   

    Did you write it, guys? I just used this method several days ago.
      

  6.   

    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);