Posted on 2003-10-27
I made a simple MFC Dialog based application. In this i created two push buttons. I want to toggle the state of the button if it is being clicked.
I added these to command handlers to act on each click on the button.
static bool b_Btn1 = !b_Btn1 ; // to trace the state of the button
m_Btn_Right.SetState(bBtn1) ; // I tried 0x004 and FALSE also
static bool b_Btn2 = !b_Btn2 ; // to trace the state of the button
m_Btn_Right.SetState(bBtn2) ; // I tried 0x004 and FALSE also
when you click on one button it is working fine.... But first clicking on Btn1 and then clicking on Btn2 (or vice-versa) changes the state of both buttons.......
Can anybody figure it out why it happens so ???