PlanetSquires Forums

Support Forums => Other Software and Code => Topic started by: Noble D. Bell on December 30, 2007, 12:34:35 PM

Title: Enabled Menu Items Still Staying Grayed?
Post by: Noble D. Bell on December 30, 2007, 12:34:35 PM
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

Title: Re: Enabled Menu Items Still Staying Grayed?
Post by: TechSupport on December 30, 2007, 03:27:45 PM
Hi Noble,

Immediately after enabling or disabling, execute the following code:

DrawMenuBar HWND_FRMMAIN



Title: Re: Enabled Menu Items Still Staying Grayed?
Post by: Noble D. Bell on December 31, 2007, 02:23:23 AM
Yup. That did the trick. Thanks.