Jump to content

menu is wicked


Recommended Posts

I don't know how I can make a sub menu

for this code:

$recentfilesmenu = GUICtrlCreateMenu ("Recent Files",$filemenu,1)

the helpfile say this

If @error <> 1 Then GUICtrlCreateMenuitem ($file,$recentfilesmenu)

EndIf

I don't get it :S

Link to comment
Share on other sites

#include <GUIConstants.au3>

$Form1 = GUICreate("Menu demo", 300, 200)
$Filemenu = GUICtrlCreateMenu("File")
$FileMenuItem1 =GUICtrlCreateMenuItem("Item 1",$Filemenu)
;a sub menu
$FileMenu2 =GUICtrlCreateMenu("Menu2",$Filemenu)
$FileMenuItem2 =GUICtrlCreateMenuItem("Menu2 Item 1",$Filemenu2)


$FileMenuExit =GUICtrlCreateMenuItem("Exit",$Filemenu)

GUISetState(@SW_SHOW)

While 1
    $nMsg = GUIGetMsg()
    Switch $nMsg
        Case $GUI_EVENT_CLOSE
            Exit
        Case $FileMenuItem1
            Msgbox(0 + 262144,"","item 1 clicked")
        Case $FileMenuExit
            Exit
    EndSwitch
WEnd

Edited to show 2 level menu

Edited by ChrisL
Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...