?? menu 的各種樣例.mb
字號:
Include "menu.def"
Define x *4
Define y *8
Declare Sub main
Declare Sub alter_menus
Declare Sub new_command_handler
Declare Sub note_sub
Declare Sub print_sub
Declare Sub enable_menu
Declare Sub disable_menu
Declare Sub create_new_menu
Declare Sub start
Declare Sub end_program
Declare Sub hello
'***********************************************************************************
Sub Main
Call alter_menus '*** Changes existing menus
Call create_new_menu '*** Creates a new menu called 'Menu Demo'
End Sub
Sub create_new_menu
Create Menu "Nested Sub Menu" As
"Enable the 'About' Command" calling enable_menu,
"Disable the 'About' Command" calling disable_menu
Create menu "&Menu Demo" As
"&About This Program" calling hello,
"(-",
"Note Statement" calling note_sub,
"Print Statement" calling print_sub,
"&Nested Sub Menu" as "Nested Sub Menu",
"&End Program" calling end_program
Alter Menu Bar remove "幫助[&H]"
Alter Menu Bar add "Menu Demo"
Alter Menu Bar add "幫助[&H]"
End sub
Sub alter_menus
Alter Menu "文件[&F]" add "New Command" calling new_command_handler
Alter Menu "維護(hù)[&W]" remove 409, "緊縮表[&P]..."
Alter Menu Bar Remove "對象[&O]"
End Sub
Sub note_sub
Note "Hello!"
End Sub
Sub print_sub
Print "The 'Print' statement puts a message or instructions in the"
Print "Message window."
End Sub
Sub new_command_handler
Note "Hello,New menu command!"
End Sub
Sub enable_menu
Alter Menu Item hello Enable
End Sub
Sub disable_menu
Alter menu item hello disable
End Sub
Sub hello
Dialog
Title "About This Program"
Width 56x
Height 21y
Control StaticText
Title "This program demonstrates programming menu commands in"
Position 2x,2y
Control OKButton
Position 43x, 18y
End Sub
Sub end_program '*** Restore the menu bar and end the program.
Create Menu Bar as Default
Close Window Message
End Program
End Sub
?? 快捷鍵說明
復(fù)制代碼
Ctrl + C
搜索代碼
Ctrl + F
全屏模式
F11
切換主題
Ctrl + Shift + D
顯示快捷鍵
?
增大字號
Ctrl + =
減小字號
Ctrl + -