I have a menu item with Checked turned on. I want to have the menu item be a toggle, which reverses the checkmark visibility each time the menu item is selected.
I found the FF_Menu_SetState function, but I can't figure out what idItem is. Is this the correct function to call to toggle a menu checkmark? If so, what do I pass in for the idItem parameter?
Hi Sean,
The idItem is the "IDC_" control identifier for the menu item. You can get these values from the F4 popup dialog (Handles and Control IDs).
Local nState As Long
nState = FF_Menu_GetState( HWND_FORM1_TOPMENU, IDC_FORM1_MNUPRINT )
nState = IIF&( nState = %MFS_CHECKED, %MFS_UNCHECKED, %MFS_CHECKED )
FF_Menu_SetState hWndForm, HWND_FORM1_TOPMENU, IDC_FORM1_MNUPRINT, nState
I get error 443: TO EXPECTED
Here is the code I ran:
Local nState As Long
nState = FF_Menu_GetState( HWND_FRMMAIN_TOPMENU, IDC_FRMMAIN_MNUTOGGLECALC )
nState = IIF&( nState = %MFS_CHECKED, %MFS_UNCHECKED, %MFS_CHECKED )
FF_Menu_SetState gHwndForm, HWND_FRMMAIN_TOPMENU, IDC_FRMMAIN_MNUTOGGLECALC, nState
The FF_Menu_SetState is causing the error.
What am I doing wrong?
I figured it out, I didn't need to pass the HwndForm