if  (!m_wndDlgBar.Create(this,IDD_DIALOG1,CBRS_LEFT|CBRS_TOP|CBRS_TOOLTIPS|CBRS_FLYBY,IDD_DIALOG1))   
      {   
      TRACE0("Failed   to   create   DlgBar\n");   
      return   -1;             //   fail   to   create   
      } 
显示的对话框,对话框上面的控件都是灰色的,不可用。应该怎么做才能使按钮可用??
谢谢大家给些代码 谢谢了

解决方案 »

  1.   

    你看下IDD_DIALOG1是不是里面的控件的属性项Disabled前打了勾?
      

  2.   

    没有处理方法之前都是Disable的,为按钮添加事件处理函数就好
      

  3.   

    更新一下按钮状态就是了void CXXX::UpdateControls(BOOL bEnabled)
    {
    for(int i = 0, j = GetToolBarCtrl().GetButtonCount(); i < j; i++)
    {
    if(GetButtonStyle(i)&(TBBS_SEPARATOR))
    continue; if(bEnabled)
    SetButtonStyle(i, GetButtonStyle(i)&(~TBBS_DISABLED));
    else
    SetButtonStyle(i, GetButtonStyle(i)|TBBS_DISABLED);
    } RedrawWindow();
    }
      

  4.   

    在CMainFrame或View中添加事件处理