|
-
August 24th, 1999, 06:48 AM
#1
disable MenuItems in CDialog
Hi,
I have a CDialog who has a menu IDR_MAINFRAME.
I want to disable some menu items at the beginning.
I used GetDlgItem(ID_EDIT); to get a CWnd* for the enableWindow-function,
but I get a NULL pointer back (I included also resource.h in the header file)
What's wrong ?
Thanx,
Grit
-
August 24th, 1999, 06:55 AM
#2
Re: disable MenuItems in CDialog
Did you try EnableMenu function of class CMenu?
Let me know if this help u
Regards,
Ovidiu
-
August 24th, 1999, 06:57 AM
#3
Re: disable MenuItems in CDialog
Add a WM_UPDATE_COMMAND mesage for your item ID.
In the implementation add this pCMDUI->Enable(FALSE);
Let me know if this helps you.
Best regards,
Faby
-
August 24th, 1999, 07:00 AM
#4
Re: disable MenuItems in CDialog
Look some detalied code
CMenu m_Menu;
m_Menu.LoadMenu( IDR_MAINFRAME );
CMenu* pMenu = m_Menu.GetSubMenu( 0 );
pMenu->EnableMenuItem( ID__EDIT, MF_DISABLED | MF_GRAYED );
Regards,
Ovidiu
-
August 24th, 1999, 08:07 AM
#5
Re: disable MenuItems in CDialog
Have you tried to override the OnUpdateCommandUI, and the set to false the enable ?
HTH, Bye !
Braulio
-
August 24th, 1999, 12:54 PM
#6
Re: disable MenuItems in CDialog - it works
Hi,
thank you, it works perfect !!!!!!!!!!!!1
Grit
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|