怎样动态生成按钮?

解决方案 »

  1.   

    place this code in .h fileCButton m_button;place this code in where you need create the buttn 
     m_button.Create(...........want detail plase find from MSDN ,there has the samples!
      

  2.   

    记得在不需要的时候调用DestroyWindow
      

  3.   

    大概就这意思: CButton* m_pButton; m_pButton =new CButton; ASSERT_VALID (m_pButton); m_pButton->Create (_T ("中文") , WS_CHILD|WS_VISIBLE|BS_PUSHBUTTON, 
    CRect ( 0, 0, 100 , 16) , this , WM_USER+88 );
      

  4.   

    在OnInitDialog里写就可以了,最后销毁的时候delete
      

  5.   

    不一定在OnInitdialog里咯,什么地方都可以
    就是创建窗口的方法了,
    new
    create
    showwindow
    updatewindow