_Vlad 2 Posted September 15, 2019 Share Posted September 15, 2019 Hello AutoIt, I'm new around here and I need help understanding GUICtrlCreateMenu function. I tried to implement 2 different Main Menus, one below other, like a submenu, but I can see that in the script it only allows me to create one. #include <GUIConstantsEx.au3> #include <WindowsConstants.au3> $Form1 = GUICreate("2 MainMenus", 615, 137, 192, 124) $MenuItem1 = GUICtrlCreateMenu("MainMenu 1") ;How to make 2 different menus? One below other? GUISetState(@SW_SHOW) While 1 $nMsg = GUIGetMsg() Switch $nMsg Case $GUI_EVENT_CLOSE Exit EndSwitch WEnd Any suggestions? Regards, :) Link to post Share on other sites
mistersquirrle 6 Posted September 16, 2019 Share Posted September 16, 2019 Hello aspectulconteazz, welcome to the forums. I recommend that you check out: GUICtrlCreateMenuItem from the help file. I think that this is what you're looking for. If it's not, can you explain more on what you're looking for? Or a screenshot example of something else that's similar. #include <GUIConstantsEx.au3> #include <WindowsConstants.au3> $Form1 = GUICreate("2 MainMenus", 615, 137, 192, 124) $MenuItem1 = GUICtrlCreateMenu("MainMenu 1") $Menu1Sub1 = GUICtrlCreateMenuItem('SubMenu1', $MenuItem1) $Menu1Sub2 = GUICtrlCreateMenuItem('SubMenu2', $MenuItem1) $MenuItem2 = GUICtrlCreateMenu("MainMenu 2") $Menu2Sub1 = GUICtrlCreateMenuItem('SubMenu1', $MenuItem2) $Menu2Sub2 = GUICtrlCreateMenuItem('SubMenu2', $MenuItem2) GUISetState(@SW_SHOW) While 1 $nMsg = GUIGetMsg() Switch $nMsg Case $GUI_EVENT_CLOSE Exit Case $Menu1Sub1 ConsoleWrite(':' & @ScriptLineNumber & ': - Menu 1, Sub 1 clicked' & @CRLF) Case $Menu1Sub2 ConsoleWrite(':' & @ScriptLineNumber & ': - Menu 1, Sub 2 clicked' & @CRLF) Case $Menu2Sub1 ConsoleWrite(':' & @ScriptLineNumber & ': - Menu 2, Sub 1 clicked' & @CRLF) Case $Menu2Sub2 ConsoleWrite(':' & @ScriptLineNumber & ': - Menu 2, Sub 2 clicked' & @CRLF) EndSwitch WEnd I added a couple menu items to your example code, and cases for them into the main loop. It'll display in the SciTE console when you click on one of the MenuItems. You can replace the ConsoleWrite with whatever you want to have happen. _Vlad 1 RAWR! I'm hungry :( Feed the panda squirrle Link to post Share on other sites
_Vlad 2 Posted October 6, 2019 Author Share Posted October 6, 2019 Hello, After many days still didn't solved the problem. What I meant is that I want to create a whole menu bar and below that other bar. For example bar number 1 to have 'File', 'Settings' with subitems and bar number 2 to be under the number 1 bar and have other main menu items. Regards, Link to post Share on other sites
Nine 1,513 Posted October 6, 2019 Share Posted October 6, 2019 Maybe create a menu and a toolbar ? _Vlad 1 Not much of a signature but working on it... Spoiler Block all input without UAC Save/Retrieve Images to/from Text Monitor Management (VCP commands) Tool to search content in au3 files Date Range Picker Virtual Desktop Manager Sudoku Game 2020 Overlapped Named Pipe IPC HotString 2.0 - Hot keys with string x64 Bitwise Operations Multi-keyboards HotKeySet Recursive Array Display Fast and simple WCD IPC Multiple Folders Selector GIF Animation (cached) Screen Scraping Link to post Share on other sites
BigDaddyO 80 Posted October 7, 2019 Share Posted October 7, 2019 as far as i'm aware, you can only have one menu bar. Maybe you could create a child window with it's own menu and embed it within your main GUI? _Vlad 1 Link to post Share on other sites
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