quick_sliver007 0 Posted February 27, 2005 How do I check to see if a ctrl is used in a Gui? What I want to do is check if a menu item is clicked. like this.... Func _checkmenuitemsave() If menu item is clicked = true then do this EndIf EndFunc case $msg = $exit Call("_checkmenuitemsave") Exitloop I want to check if the menu item save is clicked any time while the program is runing, so that it does something on exit if it was clicked. Please help. . Share this post Link to post Share on other sites
phillip123adams 0 Posted February 27, 2005 One way is when the menu item is clicked, trap it in the while loop and set a variable accordingly. Later, when exiting the script, check the current value of the variable to decide what steps to take. For another method, see the example in the help file for GUICtrlCreateMenuitem and look at what is done for the menu item $viewstatusitem. Phillip Share this post Link to post Share on other sites
quick_sliver007 0 Posted February 27, 2005 One way is when the menu item is clicked, trap it in the while loop and set a variable accordingly. Later, when exiting the script, check the current value of the variable to decide what steps to take.For another method, see the example in the help file for GUICtrlCreateMenuitem and look at what is done for the menu item $viewstatusitem.<{POST_SNAPBACK}>I have no ideal how to trap it and I don't think the otherway would work. But, I just had an ideal,case msg = $saveiniwrite 1 to some where on character inicase msg = $exit$var = iniread where that 1 isIf $var = 1 then do thisElsedo otherend ifexitloopI think will try it tomorrow. All of this programing is cutting in on my sleep.Thank you Phil, for being most helpful. . Share this post Link to post Share on other sites
phillip123adams 0 Posted February 28, 2005 I have no ideal how to trap it and I don't think the otherway would work. But, I just had an ideal,<{POST_SNAPBACK}>By "trap", I meant to assign the menu buttons to a variable, then in the While loop, check the value of $msg in the Select statement. If it's a menu button, assign a value to a variable so that later you will know it was clicked. Phillip Share this post Link to post Share on other sites