bhstanes
asked on
Changing Properties of an activex control
I am a novice and I have an existing program that I am trying to edit. There is a dialog box that has several buttons that I needed to color. I found that I could easily create new buttons by inserting an activex control (Microsoft Form Command Button). After doing so I found that the buttons I changed would no longer enable and diable during program execution like they were supposed to. The orignal code had a member variable assigned to the button. That member variable was a CButton type. I deleted that member variable and put in one with the same name but a CCommandButton type. Originally the code called in a function called EnablePBs and the ran that through a code
void CR5KDlg::EnablePBs(BOOL bEnable)
{
m_btnDownload.EnableWindow (bEnable);
m_btnEraseFlash.EnableWind ow(bEnable );
m_btnSetDateTime.EnableWin dow(bEnabl e);
int nCmdShow = SW_SHOW;
if (bEnable)
{
nCmdShow = SW_HIDE;
m_ProgressCtrl.SetPos(0);
m_stSteps.SetWindowText("" );
m_stPctComplete.SetWindowT ext("");
}
m_ProgressCtrl.ShowWindow( nCmdShow);
m_stSteps.ShowWindow(nCmdS how);
m_stPctComplete.ShowWindow (nCmdShow) ;
}
I have tried changing the code to m_btnname.SetEnabled(bEnab le), but that just causes exception errors. I am not sure exactly what to do to make this work. PLease Help.
void CR5KDlg::EnablePBs(BOOL bEnable)
{
m_btnDownload.EnableWindow
m_btnEraseFlash.EnableWind
m_btnSetDateTime.EnableWin
int nCmdShow = SW_SHOW;
if (bEnable)
{
nCmdShow = SW_HIDE;
m_ProgressCtrl.SetPos(0);
m_stSteps.SetWindowText(""
m_stPctComplete.SetWindowT
}
m_ProgressCtrl.ShowWindow(
m_stSteps.ShowWindow(nCmdS
m_stPctComplete.ShowWindow
}
I have tried changing the code to m_btnname.SetEnabled(bEnab
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.