sub SetStateMenu(ByVal menu As HMENU, ByVal item As Integer,ByVal State As Integer)
Позволяет устанавливать различные состояния пунктов меню
menu - хендл меню
item - пункт меню
State - статус меню, может быть:
0 - меню активно, флажок не установлен
1 - пункт меню недоступен, отображается серым цветом
2 - пункт меню недоступен (в Linux тоже самое, что и под цифрой 1)
3 - Установить флажок
Windows , Linux
#Include "window9.bi"
Dim As HMENU menu,MenName,MenName1,MenName2
OpenWindow("",10,10,400,400)
menu=Create_Menu()
MenName=MenuTitle(menu,"Файл")
MenName1=MenuTitle(menu,"Помощь")
MenuItem(1001,MenName,"1 меню")
MenuItem(1002,MenName,"2 меню")
ButtonGadget(1,10,50,150,30,"установить флажок")
Do
Var event=WaitEvent
If event=EventGadget then
Select case EventNumber
Case 1
SetStateMenu(menu,1001,3)
End Select
EndIf
If event=EventClose Then End
Loop
Created with the Personal Edition of HelpNDoc: Free EBook and documentation generator