Jump to content

how can i use guigetmsg() from menus w/o submenu


ptt
 Share

Recommended Posts

I tried to make the menu using GUICtrlCreateMenu only (without using GUICtrlCreateMenuItem).... for example : view1 = GUICtrlCreateMenu("View1"), view2 = GUICtrlCreateMenu("View2")

When i use guigetmsg() , and when i try to select either view 1 or view2, it wont return any thing for guigetmsg().....what shoujd i do ? Please help me out.........I really dont wnt to create submenu due to my work has lots of repeated test i dont wnt to click further down to submenu.

tx in advanced.

Link to comment
Share on other sites

$openafile = GUICtrlCreateMenu("OpenFile")

$Closeafile = GUICtrlCreateMenu("Close")

for example i hve menus above ( those are not GUICtrlCreateMenuItem).....when i click on either , In VB6, it is mnuOpen_click()

what is the equivalent code when a menu selected in au3 ?

Link to comment
Share on other sites

This'll probly be the best youll get:

$Gui = GUICreate("beef", 100, 100)
$Menu = GUICtrlCreateMenu("File")
$Open = GUICtrlCreateMenuitem("Open File", $Menu)
$Close = GUICtrlCreateMenuitem("Close", $Menu)
GUISetState(@SW_SHOW)

While 1
    $nMsg = GUIGetMsg()
    Switch $nMsg
        Case $Open
            FileOpenDialog("Choose a file.", @HomeDrive, "(*.*)")
        Case $Close
            Exit
    EndSwitch
    Sleep(10)
WEnd

But what do I know.

# MY LOVE FOR YOU... IS LIKE A TRUCK- #
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...