tweakster2010 Posted June 23, 2015 Share Posted June 23, 2015 Hey All, I am having an issue getting checkmenuitem to check the box. The Example works but when i mirror its use or parts of the use it does not work. Here is what I have but my question is am I not using enough of the example for that particular portion to work?$UI = GUICreate("UI", 301, 506, 1165, 157) $FileMenu = GUICtrlCreateMenu("&File") $FileItemInstall = GUICtrlCreateMenuItem("&Installations", $FileMenu) GuiSetState(@SW_SHOW) _GUICtrlMenu_CheckMenuItem($FileMenu,1)I have tried it with $filemenu and with $fileiteminstall and 0/1 and with filemenu,fileiteminstall. Everywhich way I go to use it I cant get it to work. Any help is totally appreciated. Link to comment Share on other sites More sharing options...
ahmet Posted June 23, 2015 Share Posted June 23, 2015 You have to use GUICtrlGetHandle(), and zero as index, becasue items are counted from zero._GUICtrlMenu_CheckMenuItem(GUICtrlGetHandle($FileMenu),0) Link to comment Share on other sites More sharing options...
tweakster2010 Posted June 23, 2015 Author Share Posted June 23, 2015 that works perfect, but i dont get why the example doesnt use that? The index 0 i did use just was missing the guitrlgethandle i guess. Just missing why. Thanks a bunch though! Link to comment Share on other sites More sharing options...
ahmet Posted June 23, 2015 Share Posted June 23, 2015 Because example does not use menu created with GUICtrlCreateMenu, which returns controlID, while _GUICtrlMenu_CreateMenu used in example returns handle of menu, and all functions starting with _GUICtrlMenu expect menu handle. Link to comment Share on other sites More sharing options...
tweakster2010 Posted June 23, 2015 Author Share Posted June 23, 2015 Thank you for the explanation. Much appreciated Link to comment Share on other sites More sharing options...
ahmet Posted June 23, 2015 Share Posted June 23, 2015 You are welcome 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