Click here to Skip to main content
15,890,557 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
GeneralRe: i can disable menu item but cannot gray it!!!!!!!! Pin
Brian Delahunty4-Aug-04 23:15
Brian Delahunty4-Aug-04 23:15 
GeneralRe: i can disable menu item but cannot gray it!!!!!!!! Pin
caykahve4-Aug-04 23:27
caykahve4-Aug-04 23:27 
GeneralRe: i can disable menu item but cannot gray it!!!!!!!! Pin
Jaime Stuardo5-Aug-04 3:39
Jaime Stuardo5-Aug-04 3:39 
GeneralRe: i can disable menu item but cannot gray it!!!!!!!! Pin
caykahve5-Aug-04 4:35
caykahve5-Aug-04 4:35 
GeneralRe: i can disable menu item but cannot gray it!!!!!!!! Pin
Jaime Stuardo5-Aug-04 5:03
Jaime Stuardo5-Aug-04 5:03 
GeneralRe: i can disable menu item but cannot gray it!!!!!!!! Pin
caykahve5-Aug-04 5:27
caykahve5-Aug-04 5:27 
GeneralRe: i can disable menu item but cannot gray it!!!!!!!! Pin
Jaime Stuardo5-Aug-04 6:06
Jaime Stuardo5-Aug-04 6:06 
Generalsolution! Pin
caykahve6-Aug-04 0:25
caykahve6-Aug-04 0:25 
I solved the problem and I'm very happy for that!! Big Grin | :-D

ok.. forget the function mapped to UPDATE_COMMAND_UI - delete it! Somewhere outside do this to switch between enabled and disabled menu items - nothing else


//enable-disable switch<br />
// Item3Enable is the bool value to decide if it will be enabled or disabled<br />
Item3Enable = !Item3Enable;<br />
<br />
UINT fGray = Item3Enable ? 0 : MF_GRAYED|MF_DISABLED;<br />
CMenu *hMenu;    <br />
hMenu = GetMenu();		    <br />
CMenu *sub;    <br />
sub = hMenu->GetSubMenu(1);    <br />
sub->EnableMenuItem(ID_SETTINGS_ITEM3, MF_BYCOMMAND|fGray);

QuestionHow to hide dialog box in MFC Pin
Rajesh_K_Sharma4-Aug-04 22:55
Rajesh_K_Sharma4-Aug-04 22:55 
AnswerRe: How to hide dialog box in MFC Pin
Brian Delahunty4-Aug-04 23:07
Brian Delahunty4-Aug-04 23:07 
GeneralRe: How to hide dialog box in MFC Pin
Rajesh_K_Sharma5-Aug-04 0:47
Rajesh_K_Sharma5-Aug-04 0:47 
GeneralRe: How to hide dialog box in MFC Pin
David Crow5-Aug-04 2:39
David Crow5-Aug-04 2:39 
QuestionDSW file format? Pin
Member 12782624-Aug-04 22:45
Member 12782624-Aug-04 22:45 
AnswerRe: DSW file format? Pin
David Crow5-Aug-04 2:42
David Crow5-Aug-04 2:42 
GeneralRe: DSW file format? Pin
Member 12782625-Aug-04 3:08
Member 12782625-Aug-04 3:08 
QuestionHow to write Custom GINA.dll Pin
anshums4-Aug-04 22:27
anshums4-Aug-04 22:27 
GeneralHai Pin
Asha Rams4-Aug-04 22:18
Asha Rams4-Aug-04 22:18 
GeneralRe: Hai Pin
David Crow5-Aug-04 2:44
David Crow5-Aug-04 2:44 
GeneralRe: Hai Pin
Anonymous9-Aug-04 0:17
Anonymous9-Aug-04 0:17 
GeneralRe: Hai Pin
David Crow9-Aug-04 2:18
David Crow9-Aug-04 2:18 
GeneralRe: Hai Pin
Asha Rams11-Aug-04 22:02
Asha Rams11-Aug-04 22:02 
GeneralRe: Hai Pin
David Crow12-Aug-04 2:52
David Crow12-Aug-04 2:52 
GeneralGetting HDN_ITEMDBLCLICK to work for ListCtrl Pin
Eldon Zacek4-Aug-04 21:51
Eldon Zacek4-Aug-04 21:51 
GeneralAdd encoding in xml file Pin
JensB4-Aug-04 21:31
JensB4-Aug-04 21:31 
QuestionHow to remove flickering of a window Pin
nnvidya4-Aug-04 21:09
nnvidya4-Aug-04 21:09 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.