Nova Posted February 4, 2005 Share 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. Link to comment Share on other sites More sharing options...
layer Posted February 4, 2005 Share 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 Link to comment Share on other sites More sharing options...
Nova Posted February 4, 2005 Author Share 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 Link to comment Share on other sites More sharing options...
jpm Posted February 4, 2005 Share 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. Link to comment Share on other sites More sharing options...
Nova Posted February 5, 2005 Author Share 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. Link to comment Share on other sites More sharing options...
jpm Posted February 5, 2005 Share 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 Link to comment Share on other sites More sharing options...
BlankMind Posted February 5, 2005 Share 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. Link to comment Share on other sites More sharing options...
jpm Posted February 5, 2005 Share 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 Link to comment Share on other sites More sharing options...
BlankMind Posted February 6, 2005 Share 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 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