xXx Posted July 15, 2006 Share Posted July 15, 2006 the code: expandcollapse popup#include <GUIConstants.au3> $filemenu = GuiCtrlCreateMenu ("File") $fileitem = GuiCtrlCreateMenuitem ("Open...",$filemenu) $recentfilesmenu = GuiCtrlCreateMenu ("Recent Files",$filemenu) $separator1 = GuiCtrlCreateMenuitem ("",$filemenu) $exititem = GuiCtrlCreateMenuitem ("Exit",$filemenu) $helpmenu = GuiCtrlCreateMenu ("?") $aboutitem = GuiCtrlCreateMenuitem ("About",$helpmenu) $Form1 = GUICreate("TEST", 498, 303) GUISetState() While 1 $msg = GuiGetMsg() Select Case $msg = $GUI_EVENT_CLOSE ExitLoop Case $msg = $fileitem $file = FileOpenDialog("Choose file...",@TempDir,"All (*.*)") Case $msg = $exititem ExitLoop Case $msg = $aboutitem Msgbox(0,"About","GUI Menu Test") Case Else ;;;;;;; EndSelect WEnd GUIDelete() Exit it is just an example and this should just create a simple GUI with a menu. but instead of creating a GUI with a menu it creates one wihtout a menu and also forces to open a file (here from the menu: Open...) i want to just have a menu and want that it opens the dialog "Choose file...." only if i press in the menu "Open..." what do i need to change to get it working? Link to comment Share on other sites More sharing options...
taurus905 Posted July 15, 2006 Share Posted July 15, 2006 i want to just have a menu and want that it opens the dialog "Choose file...." only if i press in the menu "Open..." what do i need to change to get it working?xXx, I only moved one line: $Form1 = GUICreate("TEST", 498, 303) taurus905 expandcollapse popup#include <GUIConstants.au3> $Form1 = GUICreate("TEST", 498, 303) $filemenu = GuiCtrlCreateMenu ("File") $fileitem = GuiCtrlCreateMenuitem ("Open...",$filemenu) $recentfilesmenu = GuiCtrlCreateMenu ("Recent Files",$filemenu) $separator1 = GuiCtrlCreateMenuitem ("",$filemenu) $exititem = GuiCtrlCreateMenuitem ("Exit",$filemenu) $helpmenu = GuiCtrlCreateMenu ("?") $aboutitem = GuiCtrlCreateMenuitem ("About",$helpmenu) GUISetState() While 1 $msg = GuiGetMsg() Select Case $msg = $GUI_EVENT_CLOSE ExitLoop Case $msg = $fileitem $file = FileOpenDialog("Choose file...",@TempDir,"All (*.*)") Case $msg = $exititem ExitLoop Case $msg = $aboutitem Msgbox(0,"About","GUI Menu Test") Case Else ;;;;;;; EndSelect WEnd GUIDelete() Exit "Never mistake kindness for weakness."-- Author Unknown --"The highest point to which a weak but experienced mind can rise is detecting the weakness of better men."-- Georg Lichtenberg --Simple Obfuscator (Beta not needed.), Random names for Vars and Funcs Link to comment Share on other sites More sharing options...
xXx Posted July 15, 2006 Author Share Posted July 15, 2006 xXx, I only moved one line: $Form1 = GUICreate("TEST", 498, 303) taurus905 #include <GUIConstants.au3> $Form1 = GUICreate("TEST", 498, 303) $filemenu = GuiCtrlCreateMenu ("File") $fileitem = GuiCtrlCreateMenuitem ("Open...",$filemenu) $recentfilesmenu = GuiCtrlCreateMenu ("Recent Files",$filemenu) $separator1 = GuiCtrlCreateMenuitem ("",$filemenu) $exititem = GuiCtrlCreateMenuitem ("Exit",$filemenu) $helpmenu = GuiCtrlCreateMenu ("?") $aboutitem = GuiCtrlCreateMenuitem ("About",$helpmenu) GUISetState() While 1 $msg = GuiGetMsg() Select Case $msg = $GUI_EVENT_CLOSE ExitLoop Case $msg = $fileitem $file = FileOpenDialog("Choose file...",@TempDir,"All (*.*)") Case $msg = $exititem ExitLoop Case $msg = $aboutitem Msgbox(0,"About","GUI Menu Test") Case Else ;;;;;;; EndSelect WEnd GUIDelete() Exit ROFL... thx for your help i really didnt see that Link to comment Share on other sites More sharing options...
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now