Nova 0 Posted February 4, 2005 Why dosent the following work ? #include <GUIConstants.au3> Opt("GuiOnEventMode", 1) GUICreate("My GUI Context Menu",300,200) $contextmenu = GUICtrlCreateContextMenu () $button = GUICtrlCreateButton("OK",100,100,70,20) GUICtrlSetOnEvent($button, "Contextmenu_disable") $buttoncontext = GUICtrlCreateContextMenu($button) $buttonitem = GUICtrlCreateMenuitem("About button",$buttoncontext) GUISetState () Func Contextmenu_disable() GUICtrlSetState ( $contextmenu, $Gui_Disable) EndFunc While 1 sleep (10) WEnd Im trying to make it so that when the button is pressed the context menu no longer appears. Share this post Link to post Share on other sites
layer 2 Posted February 4, 2005 (edited) you do have the actuall loop right? not just sleep(10)EDIT: my mistake, ive never used OnEvent mode before, sorry hmmm Edited February 4, 2005 by layer FootbaG Share this post Link to post Share on other sites
Nova 0 Posted February 4, 2005 you do have the actuall loop right? not just sleep(10)Lol nope , Tnx Layer but in future plz dont post a blind guess Share this post Link to post Share on other sites
jpm 93 Posted February 4, 2005 Lol nope , Tnx Layer but in future plz dont post a blind guess <{POST_SNAPBACK}>Contextmenu cannot have state change just delete and recreate if needed. Share this post Link to post Share on other sites
Nova 0 Posted February 5, 2005 Contextmenu cannot have state change just delete and recreate if needed.From help file GUICtrlDelete This function does not currently work on context menu controls.I really need to be able to hide/show a context menu, is there any change autoit could be edited to allow this ?I use this method alot with other ctrls, I create them at the start of my script and hide them, then later on unhide them from within functions.If you cant understand my need im sure I can write you a script to explain it better. Share this post Link to post Share on other sites
jpm 93 Posted February 5, 2005 From help file GUICtrlDelete I really need to be able to hide/show a context menu, is there any change autoit could be edited to allow this ?I use this method alot with other ctrls, I create them at the start of my script and hide them, then later on unhide them from within functions.If you cant understand my need im sure I can write you a script to explain it better.<{POST_SNAPBACK}>I can really understand your need.But ContextMenu are design in a such a way (Holger can confirm) that only GuiCtrlDetelete can be use to have a correct handling.The best can be you design a fonction with create the contextmenu you can recall when you want to have it back.Sorry for not having a more simpler solution to your problem Share this post Link to post Share on other sites
BlankMind 0 Posted February 5, 2005 Just another question: What's this "GUICreate" that you always says in forum? I haven't found anything about it on AutoIT3 documentation. Share this post Link to post Share on other sites
jpm 93 Posted February 5, 2005 Just another question: What's this "GUICreate" that you always says in forum? I haven't found anything about it on AutoIT3 documentation.<{POST_SNAPBACK}>You have to download the beta version to access to GUI functions Share this post Link to post Share on other sites
BlankMind 0 Posted February 6, 2005 You have to download the beta version to access to GUI functions <{POST_SNAPBACK}>I've already done this and I'm learning GUI functions, thank you for helping Share this post Link to post Share on other sites