Jump to content
Sign in to follow this  

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)


I don't get it :S

Share this post

Link to post
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)


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

Edited to show 2 level menu

Edited by ChrisL

Share this post

Link to post
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
Sign in to follow this  


Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.