Enabled Menu Items Still Staying Grayed?

Started by Noble D. Bell, December 30, 2007, 12:34:35 PM

Previous topic - Next topic

Noble D. Bell

I am using the following line of code to enable/disable menu items:

To Disable:

EnableMenuItem (HWND_FRMMAIN_TOPMENU, IDC_FRMMAIN_MNUEDIT, %MF_BYCOMMAND Or %MF_DISABLED Or %MF_GRAYED)


To Enable:

EnableMenuItem (HWND_FRMMAIN_TOPMENU, IDC_FRMMAIN_MNUEDIT, %MF_BYCOMMAND Or %MF_ENABLED)


Disabling seems to work just fine. But, after I enable the menu it still stays "grayed" until I click on the item with my mouse pointer then it starts working. Is there some sort of refresh or repaint function that I need to call?

nb


TechSupport

Hi Noble,

Immediately after enabling or disabling, execute the following code:

DrawMenuBar HWND_FRMMAIN




Noble D. Bell