Hi;
I have an edit control that takes string input from user and a CButton 'Record' to record that input. I want to catch the control and disable it when the user input is empty. I want to make sure that this enable/diable happens with the click of Record CButton.
void CCTRL::OnBnClickedAns() // code for Cbutton
{
CString txt;
if(!end)
{
IsCorrect(s); // comparing and checking user input
m_input.SetCheck(0);
if(Check())
Run();
}
}
* IsCorrect() is where user input is checked and compard with correct text.
Can I use OnEnUpdateAns() control to achieve it. e.g.
vodi CCTRL::OnEnUpdateAns()
{
if (txt!="")
{
m_rec.EnableWindow(TRUE);
}
else
{
if (txt=="")
{
m_rec.EnableWindow(FALSE);
}
Any suggestions to get this done or if you have some otehr idea, kindly share.