How To Change The Properties Of A Button At Runtime
Assuming that you have set the button's ID as IDC_BTNSAMPLE in the resource editor :-We have to use the ModifyStyle Function to do this. The function is defined as follows :- CButton *pBtnSample = (CButton *)GetDlgItem(IDC_BTNSAMPLE); // Make the button look like a checkboxpBtnSample->ModifyStyle(0,BS_AUTOCHECKBOX,SWP_FRAMECHANGED); // Remove the checkbox style and make it again normal pBtnSample->ModifyStyle(BS_AUTOCHECKBOX,0,SWP_FRAMECHANGED);
2009-2016 downloadmela.com. All rights reserved.