alawoona 0 Posted September 26, 2004 (edited) What am i doing wrong - When I enter <ALT>f the file menu does not open? Tried the example in the help file and it seems to work. #include "GUIConstants.au3" GUICreate("My GUI menu",300,200) $oFileMenu = GUICtrlCreateMenu ("&File") $oFileNew = GUICtrlCreateMenuItem ( "&New", $oFileMenu ) $oFileOpen = GUICtrlCreateMenuItem ("&Open",$oFileMenu) $oRecentFilesMenu = GUICtrlCreateMenu ("Recent Files",$oFileMenu,2) $oSeparator1 = GUICtrlCreateMenuitem ("",$oFileMenu,3) $oSaveFile = GUICtrlCreateMenuitem ("&Save", $oFileMenu) GUICtrlSetState($oSaveFile,$GUI_DISABLE) $oSaveFileAs = GUICtrlCreateMenuitem ("Save &As...", $oFileMenu) GUICtrlSetState($oSaveFileAs,$GUI_DISABLE) $oSeparator2 = GUICtrlCreateMenuitem ("",$oFileMenu,6) $oClose = GUICtrlCreateMenuitem ("&Close", $oFileMenu) $oEditMenu = GUICtrlCreateMenu ( "&Edit" ) GUISetState () While 1 $msg = GUIGetMsg() If $msg = $oFileOpen Then $file = FileOpenDialog("Choose file...",@TempDir,"All (*.*)") EndIf If $msg = $oClose Then GUIDelete() Exit EndIf WEnd GUIDelete() Exit Edited September 26, 2004 by alawoona Share this post Link to post Share on other sites
CyberSlug 6 Posted September 27, 2004 If you add the following two lines to the start of your script, the problem goes away:$okbutton = GUICtrlCreateButton ("OK",50,130,70,20) GUICtrlSetState(-1,$GUI_FOCUS) So why does the $GUI_FOCUS affect the Alt keys? Use Mozilla | Take a look at My Disorganized AutoIt stuff | Very very old: AutoBuilder 11 Jan 2005 prototype I need to update my sig! Share this post Link to post Share on other sites
Holger 14 Posted September 28, 2004 Will take a look at later. @CyberSlug: you don't need this. Something like: GUICtrlCreateLabel("",1,1) will also solve temporarly the problem... Hmm.... Old project:GUI/Tray menu with icons and colorsOther old stuff:IconFileScanner, TriState/ThreeState GUI TreeView, GUI ContextMenu created out of a TreeView Share this post Link to post Share on other sites
Holger 14 Posted September 28, 2004 (edited) UpdateSeems to be a general problem with a menu- and 'controlfree'-window.I used some other sample menu applications and removed the controls from the windows -> and now they have the same problem.So I see no chance to correct a default-will-ever-happens-bug P.S.: I never saw an application with only menus in it but however, you could use the small workaround with creating a small label.I somebody knows a solution let us know So long and regardsHolger Edited September 28, 2004 by Holger Old project:GUI/Tray menu with icons and colorsOther old stuff:IconFileScanner, TriState/ThreeState GUI TreeView, GUI ContextMenu created out of a TreeView Share this post Link to post Share on other sites
alawoona 0 Posted September 29, 2004 Thanx Holger - there will be other controls in my GUI so that will overcome the "problem" Share this post Link to post Share on other sites