veesub
April 30th, 1999, 02:21 AM
Hi,
how to disable a push button control through code. If anyone knows please inform. Thank you bye.
how to disable a push button control through code. If anyone knows please inform. Thank you bye.
|
Click to See Complete Forum and Search --> : disabling pushbutton through code veesub April 30th, 1999, 02:21 AM Hi, how to disable a push button control through code. If anyone knows please inform. Thank you bye. Troy T April 30th, 1999, 02:23 AM Assuming that the button's control ID is IDC_MYBUTTON, you can do the following: GetDlgItem(IDC_MYBUTTON)->EnableWindow(FALSE); If you want to completely hide the button from view, you can do this: GetDlgItem(IDC_MYBUTTON)->ShowWindow(SW_HIDE); And to restore the button to view, do this: GetDlgItem(IDC_MYBUTTON)->ShowWindow(SW_SHOW); Hope this helps! Good luck! - Troy Rudolf April 30th, 1999, 02:29 AM Hi, connect Your button with a member variable of Your dialogclass (assuming You're using a dialog...) and call ModifyStyle(0, WS_DISABLED). The next time the button is drawn, it is drawn as disabled (You might want to redraw it immediately, because until then it IS disabled even if it doesn't look so). HTH Rudolf codeguru.com
Copyright Internet.com Inc., All Rights Reserved. |