Property Pages and Buttons
-
I have implemented a Property Sheet with multiple property pages. I have set a few buttons on one of my pages and can't seem to get a handle to allow me to disable (grey) the button. I know I am doing something wrong and can't figure it out so please point me in the right direction. Sample code or correcting mine would help the most.
CWnd *pWnd = AfxGetMainWnd(); CButton* pButton = (CButton*) pWnd->GetDlgItem(IDC_ENGINE_LIGHT_DELETE); pButton->EnableWindow(FALSE);
Thanks! John Hagen -
I have implemented a Property Sheet with multiple property pages. I have set a few buttons on one of my pages and can't seem to get a handle to allow me to disable (grey) the button. I know I am doing something wrong and can't figure it out so please point me in the right direction. Sample code or correcting mine would help the most.
CWnd *pWnd = AfxGetMainWnd(); CButton* pButton = (CButton*) pWnd->GetDlgItem(IDC_ENGINE_LIGHT_DELETE); pButton->EnableWindow(FALSE);
Thanks! John HagenThis worked for me with list controls from within your propertysheet class: CMyPropertyPage m_myPage; CButton* pButton = (CButton*) m_myPage.GetDlgItem(IDC_ENGINE_LIGHT_DELETE); pButton->EnableWindow(FALSE);
-
This worked for me with list controls from within your propertysheet class: CMyPropertyPage m_myPage; CButton* pButton = (CButton*) m_myPage.GetDlgItem(IDC_ENGINE_LIGHT_DELETE); pButton->EnableWindow(FALSE);
-
That works for me, too, though I normally handle the button management local to the propertypage, so don't have the m_myPage indirection, e.g. CButton* m_rbFile = (CButton*) GetDlgItem(IDC_BUTTON); m_rbFile->EnableWindow(FALSE); Debbie
Hi Debbie, Thanks for the code. It worked perfectly. I appreciate youtaking the time to post help to my question. John
-
This worked for me with list controls from within your propertysheet class: CMyPropertyPage m_myPage; CButton* pButton = (CButton*) m_myPage.GetDlgItem(IDC_ENGINE_LIGHT_DELETE); pButton->EnableWindow(FALSE);
Thanks for the sample code. It is what I needed to get over this minor hurdle. I appreciate your time and effort. John