把源码贴出来看看
通常对应button1为OnButton1,对应button2为OnButton2...
你可以用DDX来做,即增加成员变量

解决方案 »

  1.   

    DDX_Control(pDX, IDC_BUTTON_CHANNEL_9, m_ctlChannel9);
    DDX_Control(pDX, IDC_BUTTON_CHANNEL_8, m_ctlChannel8);
    DDX_Control(pDX, IDC_BUTTON_CHANNEL_7, m_ctlChannel7);
    DDX_Control(pDX, IDC_BUTTON_CHANNEL_6, m_ctlChannel6);
    DDX_Control(pDX, IDC_BUTTON_CHANNEL_5, m_ctlChannel5);
    DDX_Control(pDX, IDC_BUTTON_CHANNEL_4, m_ctlChannel4);
    DDX_Control(pDX, IDC_BUTTON_CHANNEL_3, m_ctlChannel3);
    DDX_Control(pDX, IDC_BUTTON_CHANNEL_24, m_ctlChannel24);
    ON_BN_CLICKED(IDC_BUTTON_CHANNEL_1, OnButtonChannel1)
    ON_BN_CLICKED(IDC_BUTTON_CHANNEL_10, OnButtonChannel10)
    ON_BN_CLICKED(IDC_BUTTON_CHANNEL_11, OnButtonChannel11)
    ON_BN_CLICKED(IDC_BUTTON_CHANNEL_12, OnButtonChannel12)
    ON_BN_CLICKED(IDC_BUTTON_CHANNEL_13, OnButtonChannel13)
    ON_BN_CLICKED(IDC_BUTTON_CHANNEL_14, OnButtonChannel14)
    ON_BN_CLICKED(IDC_BUTTON_CHANNEL_15, OnButtonChannel15)
    void CSelectDialog::OnButtonChannel1() 
    {
    // TODO: Add your control notification handler code here
    MessageBox ( "Hello " );
    if ( m_bState[0] )
    {
    m_ctlChannel1.SetState ( FALSE );
    m_bState[0] = false;
    }
    else // 
    {
    m_ctlChannel1.SetState ( TRUE );
    m_bState[0] = true;
    }
    }void CSelectDialog::OnButtonChannel10() 
    {
    // TODO: Add your control notification handler code here
    MessageBox ( "Hello " );
    if ( m_bState[9] )
    {
    m_ctlChannel10.SetState ( FALSE );
    m_bState[9] = false;
    }
    else // 
    {
    m_ctlChannel10.SetState ( TRUE );
    m_bState[9] = true;
    }
    }
      

  2.   

    每次按完 button1时,在按button2十都要响应一下button1我真受不了。如果这样的话那么这必定是个大的bug
      

  3.   

    在Resource.h中看看这几个按钮的ID是否被设置成相同的值了
      

  4.   

    绝对不是。我估计是setState函数造成的。每次按完了button1后,按其他按钮响应一次button1 button1弹起,再之后按别的按钮就不响应button1了。
      

  5.   

    你先单部调式看看。当按完BUTTON1时都执行哪些操作?
    再按下BUTTON2时看看执行哪些操作?