Good day
How will I access a specific menu option to gray it?
The code example is something like this:
MenuName is string
MenuName = EnumMenu("WIN_MAIN", 1) // Read the 1st menu of the windowv MyWindow
WHILE MenuName <> ""
j is int = 1
NameSubMenu is string
NameSubMenu = EnumMenu(MenuName, j) // Read the 1st option of the menu
WHILE NameSubMenu <>""
IF HReadSeekFirst(WMenuAccess,MenuNameMenuIndex,[MenuName,IntegerPart(Val(Replace(NameSubMenu,MenuName+"_","")))]) THEN
IF WMenuAccess.MenuAllowed = False THEN
MenuSelectMinus(NameSubMenu)
ELSE
MenuSelectPlus(NameSubMenu)
END
//MenuName..NameSubMenu..Grayed = WMenuAccess.MenuAllowed
END
j++ // Next option
NameSubMenu = EnumMenu(MenuName, j)
END
i++ // Next menu
MenuName = EnumMenu(MyWindow, i)
END
The MenuSelectPlus or MenuSelectMinus returns an error saying that 'No menu option named ???? was found but it is there.
Thanks in advance
Ericus Steyn
How will I access a specific menu option to gray it?
The code example is something like this:
MenuName is string
MenuName = EnumMenu("WIN_MAIN", 1) // Read the 1st menu of the windowv MyWindow
WHILE MenuName <> ""
j is int = 1
NameSubMenu is string
NameSubMenu = EnumMenu(MenuName, j) // Read the 1st option of the menu
WHILE NameSubMenu <>""
IF HReadSeekFirst(WMenuAccess,MenuNameMenuIndex,[MenuName,IntegerPart(Val(Replace(NameSubMenu,MenuName+"_","")))]) THEN
IF WMenuAccess.MenuAllowed = False THEN
MenuSelectMinus(NameSubMenu)
ELSE
MenuSelectPlus(NameSubMenu)
END
//MenuName..NameSubMenu..Grayed = WMenuAccess.MenuAllowed
END
j++ // Next option
NameSubMenu = EnumMenu(MenuName, j)
END
i++ // Next menu
MenuName = EnumMenu(MyWindow, i)
END
The MenuSelectPlus or MenuSelectMinus returns an error saying that 'No menu option named ???? was found but it is there.
Thanks in advance
Ericus Steyn