Sign in to follow this  
Followers 0
peter123

menu is wicked

2 posts in this topic

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

Share this post


Link to post
Share on other sites



#2 ·  Posted (edited)

#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

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  
Followers 0