C++ ShowWindow issue - Button not reappearing

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
 
V

Victor Bazarov

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 [..]

can anyone help? thanks in advance i appreciate any help

Somebody in a Windows programming newsgroup can hopefully help. Your
question has nothing to do with C++ language, and everything to do with
programming MS Windows (or their Window Manager) using MS Windows API.
Off-topic here.

V
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
474,201
Messages
2,571,051
Members
47,656
Latest member
rickwatson

Latest Threads

Top