L
Leatherface123
hi, i'm just learning C++. I want to make a button disappear when the
user unchecks a checkbox, and make it reappear when he checks the box
again. the problem is, the line
GetDlgItem(IDC_RUNPGM) ->ShowWindow(TRUE);
does not make it reappear.
here is some more code that may be useful, but if you need to see more
i can paste the whole thing:
void CTag2Dlg::OnCkshwmsg()
{
UpdateData(TRUE);
if (m_bShowMsg == TRUE)
{
GetDlgItem(IDC_MSG) ->ShowWindow(FALSE);
GetDlgItem(IDC_SHWMSG) ->ShowWindow(FALSE);
GetDlgItem(IDC_DFLTMSG) ->ShowWindow(FALSE);
GetDlgItem(IDC_CLRMSG) ->ShowWindow(FALSE);
GetDlgItem(IDC_STATICMSG) ->ShowWindow(FALSE);
}
else
GetDlgItem(IDC_MSG) ->ShowWindow(TRUE);
GetDlgItem(IDC_SHWMSG) ->ShowWindow(TRUE);
GetDlgItem(IDC_DFLTMSG) ->ShowWindow(TRUE);
GetDlgItem(IDC_CLRMSG) ->ShowWindow(TRUE);
GetDlgItem(IDC_STATICMSG) ->ShowWindow(TRUE);
}
void CTag2Dlg::OnCkshwpgm()
{
UpdateData(TRUE);
if (m_bShowPgm == TRUE)
{
GetDlgItem(IDC_STATICPGM) ->ShowWindow(TRUE);
//GetDlgItem(IDC_PROGTORUN) ->ShowWindow(TRUE);
GetDlgItem(IDC_RUNPGM) ->ShowWindow(TRUE);
}
else
GetDlgItem(IDC_STATICPGM) ->ShowWindow(FALSE);
//GetDlgItem(IDC_PROGTORUN) ->ShowWindow(FALSE);
GetDlgItem(IDC_RUNPGM) ->ShowWindow(FALSE);
}
can anyone help? thanks in advance i appreciate any help
user unchecks a checkbox, and make it reappear when he checks the box
again. the problem is, the line
GetDlgItem(IDC_RUNPGM) ->ShowWindow(TRUE);
does not make it reappear.
here is some more code that may be useful, but if you need to see more
i can paste the whole thing:
void CTag2Dlg::OnCkshwmsg()
{
UpdateData(TRUE);
if (m_bShowMsg == TRUE)
{
GetDlgItem(IDC_MSG) ->ShowWindow(FALSE);
GetDlgItem(IDC_SHWMSG) ->ShowWindow(FALSE);
GetDlgItem(IDC_DFLTMSG) ->ShowWindow(FALSE);
GetDlgItem(IDC_CLRMSG) ->ShowWindow(FALSE);
GetDlgItem(IDC_STATICMSG) ->ShowWindow(FALSE);
}
else
GetDlgItem(IDC_MSG) ->ShowWindow(TRUE);
GetDlgItem(IDC_SHWMSG) ->ShowWindow(TRUE);
GetDlgItem(IDC_DFLTMSG) ->ShowWindow(TRUE);
GetDlgItem(IDC_CLRMSG) ->ShowWindow(TRUE);
GetDlgItem(IDC_STATICMSG) ->ShowWindow(TRUE);
}
void CTag2Dlg::OnCkshwpgm()
{
UpdateData(TRUE);
if (m_bShowPgm == TRUE)
{
GetDlgItem(IDC_STATICPGM) ->ShowWindow(TRUE);
//GetDlgItem(IDC_PROGTORUN) ->ShowWindow(TRUE);
GetDlgItem(IDC_RUNPGM) ->ShowWindow(TRUE);
}
else
GetDlgItem(IDC_STATICPGM) ->ShowWindow(FALSE);
//GetDlgItem(IDC_PROGTORUN) ->ShowWindow(FALSE);
GetDlgItem(IDC_RUNPGM) ->ShowWindow(FALSE);
}
can anyone help? thanks in advance i appreciate any help