{"id":515,"date":"2025-06-23T11:55:22","date_gmt":"2025-06-23T11:55:22","guid":{"rendered":"https:\/\/xojo.itbib4you.be\/?page_id=515"},"modified":"2025-06-23T12:17:33","modified_gmt":"2025-06-23T12:17:33","slug":"xojo-menus","status":"publish","type":"page","link":"https:\/\/xojo.itbib4you.be\/index.php\/xojo-menus\/","title":{"rendered":"Xojo Menus"},"content":{"rendered":"\n<div class=\"wp-block-buttons is-layout-flex wp-block-buttons-is-layout-flex\">\n<div class=\"wp-block-button has-custom-width wp-block-button__width-25\"><a class=\"wp-block-button__link has-light-green-cyan-to-vivid-green-cyan-gradient-background has-background has-small-font-size has-custom-font-size wp-element-button\" href=\"https:\/\/xojo.itbib4you.be\/\">Overview<\/a><\/div>\n<\/div>\n\n\n\n<h2 class=\"wp-block-heading\">Introduction<\/h2>\n\n\n\n<p>Apps use menus to give users access to the available actions offered by the application. In Xojo, you can use three different types of menus: <mark style=\"background-color:rgba(0, 0, 0, 0)\" class=\"has-inline-color has-bright-red-color\">MenuBar menus<\/mark>, <mark style=\"background-color:rgba(0, 0, 0, 0)\" class=\"has-inline-color has-bright-red-color\">Toolbar menus<\/mark> and <mark style=\"background-color:rgba(0, 0, 0, 0)\" class=\"has-inline-color has-bright-red-color\">Contextual menus<\/mark>. This lesson discusses the use of these three types applied to our Account example.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\">MenuBar menu<\/h2>\n\n\n\n<h3 class=\"wp-block-heading\">Create a menu with the Menu Editor<\/h3>\n\n\n<div class=\"wp-block-image\">\n<figure class=\"alignleft size-full is-resized\"><img loading=\"lazy\" decoding=\"async\" width=\"494\" height=\"416\" src=\"https:\/\/xojo.itbib4you.be\/wp-content\/uploads\/2025\/06\/Schermafbeelding-2025-06-16-om-11.47.34.png\" alt=\"MainMenuBar\" class=\"wp-image-522\" style=\"width:162px;height:auto\" srcset=\"https:\/\/xojo.itbib4you.be\/wp-content\/uploads\/2025\/06\/Schermafbeelding-2025-06-16-om-11.47.34.png 494w, https:\/\/xojo.itbib4you.be\/wp-content\/uploads\/2025\/06\/Schermafbeelding-2025-06-16-om-11.47.34-300x253.png 300w\" sizes=\"auto, (max-width: 494px) 85vw, 494px\" \/><\/figure>\n<\/div>\n\n\n<p>The <mark style=\"background-color:rgba(0, 0, 0, 0)\" class=\"has-inline-color has-bright-red-color\">Menubar menu<\/mark> is the standard main menu that appears almost always at the top of the screen. When creating a new desktop project, Xojo will always add a minimal menu (<mark style=\"background-color:rgba(0, 0, 0, 0)\" class=\"has-inline-color has-bright-blue-color\">MainMenuBar<\/mark>) to the application.<\/p>\n\n\n\n<p>All items of <mark style=\"background-color:rgba(0, 0, 0, 0)\" class=\"has-inline-color has-bright-blue-color\">MainMenuBar <\/mark>are globally available from all methods in the App.<\/p>\n\n\n\n<p>The Xojo Menu Editor is a very convenient and easy tool to edit the <mark style=\"background-color:rgba(0, 0, 0, 0)\" class=\"has-inline-color has-bright-blue-color\">MainMenuBar<\/mark>. You can open the  Menu Editor by selecting <mark style=\"background-color:rgba(0, 0, 0, 0)\" class=\"has-inline-color has-bright-blue-color\">MainMenuBar<\/mark> in the project browser (see previous screenshot).<\/p>\n\n\n<div class=\"wp-block-image\">\n<figure class=\"aligncenter size-full is-resized\"><img loading=\"lazy\" decoding=\"async\" width=\"790\" height=\"108\" src=\"https:\/\/xojo.itbib4you.be\/wp-content\/uploads\/2025\/06\/Schermafbeelding-2025-06-16-om-14.49.36.png\" alt=\"Menu Editor\" class=\"wp-image-527\" style=\"width:380px;height:auto\" srcset=\"https:\/\/xojo.itbib4you.be\/wp-content\/uploads\/2025\/06\/Schermafbeelding-2025-06-16-om-14.49.36.png 790w, https:\/\/xojo.itbib4you.be\/wp-content\/uploads\/2025\/06\/Schermafbeelding-2025-06-16-om-14.49.36-300x41.png 300w, https:\/\/xojo.itbib4you.be\/wp-content\/uploads\/2025\/06\/Schermafbeelding-2025-06-16-om-14.49.36-768x105.png 768w\" sizes=\"auto, (max-width: 790px) 85vw, 790px\" \/><figcaption class=\"wp-element-caption\">Menu Editor<\/figcaption><\/figure>\n<\/div>\n\n\n<div class=\"wp-block-columns is-layout-flex wp-container-core-columns-is-layout-9d6595d7 wp-block-columns-is-layout-flex\">\n<div class=\"wp-block-column is-layout-flow wp-block-column-is-layout-flow\" style=\"flex-basis:100%\">\n<figure class=\"wp-block-table aligncenter has-small-font-size\"><table class=\"has-fixed-layout\"><thead><tr><th class=\"has-text-align-center\" data-align=\"center\">Icon<\/th><th>Description<\/th><\/tr><\/thead><tbody><tr><td class=\"has-text-align-center\" data-align=\"center\"><img loading=\"lazy\" decoding=\"async\" width=\"30\" height=\"24\" class=\"wp-image-530\" style=\"width: 30px;\" src=\"https:\/\/xojo.itbib4you.be\/wp-content\/uploads\/2025\/06\/Schermafbeelding-2025-06-16-om-14.56.47.png\" alt=\"Add item level 1\"><\/td><td>create a new item on the first level of the menu<\/td><\/tr><tr><td class=\"has-text-align-center\" data-align=\"center\"><img loading=\"lazy\" decoding=\"async\" width=\"30\" height=\"22\" class=\"wp-image-532\" style=\"width: 30px;\" src=\"https:\/\/xojo.itbib4you.be\/wp-content\/uploads\/2025\/06\/Schermafbeelding-2025-06-16-om-15.01.27.png\" alt=\"add item 2nd level\"><\/td><td>create a new item in the selected first level menu<\/td><\/tr><tr><td class=\"has-text-align-center\" data-align=\"center\"><img loading=\"lazy\" decoding=\"async\" width=\"30\" height=\"25\" class=\"wp-image-533\" style=\"width: 30px;\" src=\"https:\/\/xojo.itbib4you.be\/wp-content\/uploads\/2025\/06\/Schermafbeelding-2025-06-16-om-15.02.54.png\" alt=\"Add separator line\"><\/td><td>add a separator line on this menu<\/td><\/tr><tr><td class=\"has-text-align-center\" data-align=\"center\"><img loading=\"lazy\" decoding=\"async\" width=\"30\" height=\"24\" class=\"wp-image-534\" style=\"width: 30px;\" src=\"https:\/\/xojo.itbib4you.be\/wp-content\/uploads\/2025\/06\/Schermafbeelding-2025-06-16-om-15.03.14.png\" alt=\"add submenu under this item\"><\/td><td>create a submenu on the selected menu item<\/td><\/tr><tr><td class=\"has-text-align-center\" data-align=\"center\"><img loading=\"lazy\" decoding=\"async\" width=\"30\" height=\"24\" class=\"wp-image-535\" style=\"width: 30px;\" src=\"https:\/\/xojo.itbib4you.be\/wp-content\/uploads\/2025\/06\/Schermafbeelding-2025-06-16-om-15.03.56.png\" alt=\"convert to first level menu\"><\/td><td>create a new menu from the selected menu item<\/td><\/tr><\/tbody><\/table><figcaption class=\"wp-element-caption\">Menu Editor: icons<\/figcaption><\/figure>\n<\/div>\n<\/div>\n\n\n\n<p>File, Edit and Help are first level menu items available in the standard menu. The first level menu item <mark style=\"background-color:rgba(0, 0, 0, 0)\" class=\"has-inline-color has-bright-blue-color\">Accounts<\/mark> have been added to this menu (with the first icon in the list).<\/p>\n\n\n<div class=\"wp-block-image\">\n<figure class=\"aligncenter size-full is-resized\"><img loading=\"lazy\" decoding=\"async\" width=\"858\" height=\"226\" src=\"https:\/\/xojo.itbib4you.be\/wp-content\/uploads\/2025\/06\/Schermafbeelding-2025-06-16-om-15.35.17.png\" alt=\"Menu items\" class=\"wp-image-543\" style=\"width:334px;height:auto\" srcset=\"https:\/\/xojo.itbib4you.be\/wp-content\/uploads\/2025\/06\/Schermafbeelding-2025-06-16-om-15.35.17.png 858w, https:\/\/xojo.itbib4you.be\/wp-content\/uploads\/2025\/06\/Schermafbeelding-2025-06-16-om-15.35.17-300x79.png 300w, https:\/\/xojo.itbib4you.be\/wp-content\/uploads\/2025\/06\/Schermafbeelding-2025-06-16-om-15.35.17-768x202.png 768w\" sizes=\"auto, (max-width: 709px) 85vw, (max-width: 909px) 67vw, (max-width: 1362px) 62vw, 840px\" \/><\/figure>\n<\/div>\n\n\n<p>The menu items <mark style=\"background-color:rgba(0, 0, 0, 0)\" class=\"has-inline-color has-bright-blue-color\">SavingsAccount<\/mark>, <mark style=\"background-color:rgba(0, 0, 0, 0)\" class=\"has-inline-color has-bright-blue-color\">CheckingAccount<\/mark> and <mark style=\"background-color:rgba(0, 0, 0, 0)\" class=\"has-inline-color has-bright-blue-color\">RetirementAccount<\/mark> have been added to the first level <mark style=\"background-color:rgba(0, 0, 0, 0)\" class=\"has-inline-color has-bright-blue-color\">Accounts<\/mark> menu item (with the second icon in the list).<\/p>\n\n\n<div class=\"wp-block-image\">\n<figure class=\"alignleft size-large is-resized\"><img loading=\"lazy\" decoding=\"async\" width=\"579\" height=\"1024\" src=\"https:\/\/xojo.itbib4you.be\/wp-content\/uploads\/2025\/06\/Schermafbeelding-2025-06-16-om-15.56.05-579x1024.png\" alt=\"Menu inspector\" class=\"wp-image-548\" style=\"width:184px;height:auto\" srcset=\"https:\/\/xojo.itbib4you.be\/wp-content\/uploads\/2025\/06\/Schermafbeelding-2025-06-16-om-15.56.05-579x1024.png 579w, https:\/\/xojo.itbib4you.be\/wp-content\/uploads\/2025\/06\/Schermafbeelding-2025-06-16-om-15.56.05-169x300.png 169w, https:\/\/xojo.itbib4you.be\/wp-content\/uploads\/2025\/06\/Schermafbeelding-2025-06-16-om-15.56.05.png 600w\" sizes=\"auto, (max-width: 579px) 85vw, 579px\" \/><\/figure>\n<\/div>\n\n\n<p>In the inspector, you need to define the <mark style=\"background-color:rgba(0, 0, 0, 0)\" class=\"has-inline-color has-bright-red-color\">Name<\/mark>of the control (e.g. <mark style=\"background-color:rgba(0, 0, 0, 0)\" class=\"has-inline-color has-bright-blue-color\">SavingsAccountItem<\/mark>) and the <mark style=\"background-color:rgba(0, 0, 0, 0)\" class=\"has-inline-color has-bright-red-color\">Text<\/mark>that will be displayed (e.g.<mark style=\"background-color:rgba(0, 0, 0, 0)\" class=\"has-inline-color has-bright-blue-color\">SavingsAccount<\/mark>). An <mark style=\"background-color:rgba(0, 0, 0, 0)\" class=\"has-inline-color has-bright-red-color\">Icon<\/mark> and a <mark style=\"background-color:rgba(0, 0, 0, 0)\" class=\"has-inline-color has-bright-red-color\">Shortcut<\/mark> can also be added.<\/p>\n\n\n\n<div style=\"height:16px\" aria-hidden=\"true\" class=\"wp-block-spacer\"><\/div>\n\n\n\n<h3 class=\"wp-block-heading\">How to set actions on a menu item?<\/h3>\n\n\n\n<p>To illustrate the use of menus, I have removed the <mark style=\"background-color:rgba(0, 0, 0, 0)\" class=\"has-inline-color has-bright-red-color\">DesktopPopupMenu<\/mark> (<mark style=\"background-color:rgba(0, 0, 0, 0)\" class=\"has-inline-color has-bright-blue-color\">AccountPopup<\/mark>) from the previous lesson and will use the selected menu item to run the program. This is the new design:<\/p>\n\n\n\n<figure class=\"wp-block-image size-large\"><img loading=\"lazy\" decoding=\"async\" width=\"1024\" height=\"495\" src=\"https:\/\/xojo.itbib4you.be\/wp-content\/uploads\/2025\/06\/Schermafbeelding-2025-06-17-om-13.33.49-1024x495.png\" alt=\"Illustration of menus\" class=\"wp-image-563\" srcset=\"https:\/\/xojo.itbib4you.be\/wp-content\/uploads\/2025\/06\/Schermafbeelding-2025-06-17-om-13.33.49-1024x495.png 1024w, https:\/\/xojo.itbib4you.be\/wp-content\/uploads\/2025\/06\/Schermafbeelding-2025-06-17-om-13.33.49-300x145.png 300w, https:\/\/xojo.itbib4you.be\/wp-content\/uploads\/2025\/06\/Schermafbeelding-2025-06-17-om-13.33.49-768x371.png 768w, https:\/\/xojo.itbib4you.be\/wp-content\/uploads\/2025\/06\/Schermafbeelding-2025-06-17-om-13.33.49.png 1192w\" sizes=\"auto, (max-width: 709px) 85vw, (max-width: 909px) 67vw, (max-width: 1362px) 62vw, 840px\" \/><\/figure>\n\n\n\n<p>Now the menu is available,  but no actions are defined yet when selecting any of the new menu items. An action can be defined via a <mark style=\"background-color:rgba(0, 0, 0, 0)\" class=\"has-inline-color has-bright-red-color\">Menu Handler<\/mark>.<\/p>\n\n\n<div class=\"wp-block-image\">\n<figure class=\"alignleft size-full is-resized\"><img loading=\"lazy\" decoding=\"async\" width=\"602\" height=\"392\" src=\"https:\/\/xojo.itbib4you.be\/wp-content\/uploads\/2025\/06\/Schermafbeelding-2025-06-17-om-11.37.09.png\" alt=\"inspector menu item\" class=\"wp-image-559\" style=\"width:193px;height:auto\" srcset=\"https:\/\/xojo.itbib4you.be\/wp-content\/uploads\/2025\/06\/Schermafbeelding-2025-06-17-om-11.37.09.png 602w, https:\/\/xojo.itbib4you.be\/wp-content\/uploads\/2025\/06\/Schermafbeelding-2025-06-17-om-11.37.09-300x195.png 300w\" sizes=\"auto, (max-width: 602px) 85vw, 602px\" \/><\/figure>\n<\/div>\n\n\n<p>A <mark style=\"background-color:rgba(0, 0, 0, 0)\" class=\"has-inline-color has-bright-red-color\">Menu Handler<\/mark> can be added via the <mark style=\"background-color:rgba(0, 0, 0, 0)\" class=\"has-inline-color has-bright-blue-color\">Insert<\/mark> button <img loading=\"lazy\" decoding=\"async\" width=\"30\" height=\"23\" class=\"wp-image-555\" style=\"width: 30px;\" src=\"https:\/\/xojo.itbib4you.be\/wp-content\/uploads\/2025\/06\/Schermafbeelding-2025-06-17-om-11.28.04.png\" alt=\"insert\"> on top of the Xojo screen. In the <mark style=\"background-color:rgba(0, 0, 0, 0)\" class=\"has-inline-color has-bright-red-color\">Inspector<\/mark>, select the menu item from the drop-down list for which you want to define an action (e.g. <mark style=\"background-color:rgba(0, 0, 0, 0)\" class=\"has-inline-color has-bright-blue-color\">CheckingAccountItem<\/mark>).<\/p>\n\n\n\n<p>In the coding pane, you can then define the action associated with the selected menu item.<\/p>\n\n\n\n<pre class=\"wp-block-preformatted has-light-gray-background-color has-background has-small-font-size\"><mark style=\"background-color:rgba(0, 0, 0, 0)\" class=\"has-inline-color has-bright-red-color\">\/\/Menu Handler for CheckingAccountItem<\/mark><br>SelectedMenuItem = CheckingAccountItem.Text<br>ProcessSelection<br><mark style=\"background-color:rgba(0, 0, 0, 0)\" class=\"has-inline-color has-bright-blue-color\">Return True<\/mark><\/pre>\n\n\n\n<p><mark style=\"background-color:rgba(0, 0, 0, 0)\" class=\"has-inline-color has-bright-blue-color\">SelectedMenuItem<\/mark> is a new private String Property belonging to <mark style=\"background-color:rgba(0, 0, 0, 0)\" class=\"has-inline-color has-bright-blue-color\">AccountWindow<\/mark>. The <mark style=\"background-color:rgba(0, 0, 0, 0)\" class=\"has-inline-color has-bright-red-color\">Text<\/mark>property of the <mark style=\"background-color:rgba(0, 0, 0, 0)\" class=\"has-inline-color has-bright-red-color\">CheckingAccountItem<\/mark>menu item is a String containing the text displayed in the menu. In the above code, the <mark style=\"background-color:rgba(0, 0, 0, 0)\" class=\"has-inline-color has-bright-blue-color\">SelectedMenuItem<\/mark> Property will contain the String &#8220;CheckingAccount&#8221;.<\/p>\n\n\n\n<p>Identical menu handlers should be added for the <mark style=\"background-color:rgba(0, 0, 0, 0)\" class=\"has-inline-color has-bright-red-color\">SavingsAccountItem<\/mark> and the <mark style=\"background-color:rgba(0, 0, 0, 0)\" class=\"has-inline-color has-bright-red-color\">RetirementAccountItem<\/mark>.<\/p>\n\n\n\n<p>The new method named <mark style=\"background-color:rgba(0, 0, 0, 0)\" class=\"has-inline-color has-bright-red-color\">ProcessSelection<\/mark> uses the private property named <mark style=\"background-color:rgba(0, 0, 0, 0)\" class=\"has-inline-color has-bright-blue-color\">SelectedMenuItem<\/mark> to determine which data should be retrieved from the database and shown in <mark style=\"background-color:rgba(0, 0, 0, 0)\" class=\"has-inline-color has-bright-blue-color\">TransactionList<\/mark>.<\/p>\n\n\n\n<pre class=\"wp-block-preformatted has-light-gray-background-color has-background has-small-font-size\"><mark style=\"background-color:rgba(0, 0, 0, 0)\" class=\"has-inline-color has-bright-red-color\">\/\/ProcessSelection<\/mark><br>ChangeActiveAccount<br><br><mark style=\"background-color:rgba(0, 0, 0, 0)\" class=\"has-inline-color has-bright-blue-color\">Var<\/mark> rs <mark style=\"background-color:rgba(0, 0, 0, 0)\" class=\"has-inline-color has-bright-blue-color\">As<\/mark> RowSet = ReadDBData<br>PopulateListBox(rs) <br><br><mark style=\"background-color:rgba(0, 0, 0, 0)\" class=\"has-inline-color has-bright-blue-color\">Var<\/mark> balance <mark style=\"background-color:rgba(0, 0, 0, 0)\" class=\"has-inline-color has-bright-blue-color\">As Currency<\/mark> = CalculateBalance <br>ActiveAccount.UpdateBalance(balance)<br>ShowBalance<\/pre>\n\n\n\n<p>Also, the <mark style=\"background-color:rgba(0, 0, 0, 0)\" class=\"has-inline-color has-bright-red-color\">ReadDBData<\/mark> method, the <mark style=\"background-color:rgba(0, 0, 0, 0)\" class=\"has-inline-color has-bright-red-color\">ShowBalance<\/mark> method and the <mark style=\"background-color:rgba(0, 0, 0, 0)\" class=\"has-inline-color has-bright-red-color\">ChangeActiveAccount<\/mark> method now use the value stored in the property <mark style=\"background-color:rgba(0, 0, 0, 0)\" class=\"has-inline-color has-bright-red-color\">SelectedMenuItem<\/mark>.<\/p>\n\n\n\n<pre class=\"wp-block-preformatted has-light-gray-background-color has-background has-small-font-size\"><mark style=\"background-color:rgba(0, 0, 0, 0)\" class=\"has-inline-color has-bright-red-color\">\/\/ReadDBData<\/mark><br><mark style=\"background-color:rgba(0, 0, 0, 0)\" class=\"has-inline-color has-bright-blue-color\">Var<\/mark> rs <mark style=\"background-color:rgba(0, 0, 0, 0)\" class=\"has-inline-color has-bright-blue-color\">As<\/mark> RowSet<br><mark style=\"background-color:rgba(0, 0, 0, 0)\" class=\"has-inline-color has-bright-blue-color\">Var<\/mark> sql <mark style=\"background-color:rgba(0, 0, 0, 0)\" class=\"has-inline-color has-bright-blue-color\">As<\/mark> String = \"SELECT AccountName, AccountDeposit, AccountWithdraw  FROM Accounts WHERE AccountName =  ?;\" <br><mark style=\"background-color:rgba(0, 0, 0, 0)\" class=\"has-inline-color has-bright-blue-color\">Try<\/mark><br>  rs = App.db.SelectSQL(sql, <mark style=\"background-color:rgba(0, 0, 0, 0)\" class=\"has-inline-color has-bright-red-color\">selectedMenuItem<\/mark>)<br><mark style=\"background-color:rgba(0, 0, 0, 0)\" class=\"has-inline-color has-bright-blue-color\">Catch<\/mark> error <mark style=\"background-color:rgba(0, 0, 0, 0)\" class=\"has-inline-color has-bright-blue-color\">As<\/mark> DatabaseException<br>  Messagebox(\"DB Select error \"+error.Message)<br>  Quit<br><mark style=\"background-color:rgba(0, 0, 0, 0)\" class=\"has-inline-color has-bright-blue-color\">End Try<\/mark><br><mark style=\"background-color:rgba(0, 0, 0, 0)\" class=\"has-inline-color has-bright-blue-color\">Return<\/mark> rs<\/pre>\n\n\n\n<pre class=\"wp-block-preformatted has-light-gray-background-color has-background has-small-font-size\"><mark style=\"background-color:rgba(0, 0, 0, 0)\" class=\"has-inline-color has-bright-red-color\">\/\/ShowBalance<\/mark><br>BalanceLabel.Text = \"The balance of the \" + <mark style=\"background-color:rgba(0, 0, 0, 0)\" class=\"has-inline-color has-bright-red-color\">selectedMenuItem<\/mark> + \" is: \" + _ <br>ActiveAccount.GetBalance.ToString(Locale.Current)<br><\/pre>\n\n\n\n<pre class=\"wp-block-preformatted has-light-gray-background-color has-background has-small-font-size\"><mark style=\"background-color:rgba(0, 0, 0, 0)\" class=\"has-inline-color has-bright-red-color\">\/\/ChangeActiveAccount<\/mark><br><mark style=\"background-color:rgba(0, 0, 0, 0)\" class=\"has-inline-color has-bright-blue-color\">Select Case<\/mark> <mark style=\"background-color:rgba(0, 0, 0, 0)\" class=\"has-inline-color has-bright-red-color\">SelectedMenuItem<\/mark><br><mark style=\"background-color:rgba(0, 0, 0, 0)\" class=\"has-inline-color has-bright-blue-color\">Case<\/mark> \"CheckingAccount\"<br>  ActiveAccount = CheckingAccount<br><mark style=\"background-color:rgba(0, 0, 0, 0)\" class=\"has-inline-color has-bright-blue-color\">Case<\/mark> \"SavingsAccount\"<br>  ActiveAccount = SavingsAccount<br><mark style=\"background-color:rgba(0, 0, 0, 0)\" class=\"has-inline-color has-bright-blue-color\">Case<\/mark> \"RetirementAccount\"<br>  ActiveAccount = RetirementAccount<br><mark style=\"background-color:rgba(0, 0, 0, 0)\" class=\"has-inline-color has-bright-blue-color\">End<\/mark> <\/pre>\n\n\n\n<h2 class=\"wp-block-heading\">Toolbar menu<\/h2>\n\n\n\n<h3 class=\"wp-block-heading\">How to create a Toolbar menu?<\/h3>\n\n\n<div class=\"wp-block-image\">\n<figure class=\"aligncenter size-large\"><img loading=\"lazy\" decoding=\"async\" width=\"1024\" height=\"507\" src=\"https:\/\/xojo.itbib4you.be\/wp-content\/uploads\/2025\/06\/Schermafbeelding-2025-06-21-om-15.35.37-1024x507.png\" alt=\"Toolbar menus\" class=\"wp-image-577\" srcset=\"https:\/\/xojo.itbib4you.be\/wp-content\/uploads\/2025\/06\/Schermafbeelding-2025-06-21-om-15.35.37-1024x507.png 1024w, https:\/\/xojo.itbib4you.be\/wp-content\/uploads\/2025\/06\/Schermafbeelding-2025-06-21-om-15.35.37-300x148.png 300w, https:\/\/xojo.itbib4you.be\/wp-content\/uploads\/2025\/06\/Schermafbeelding-2025-06-21-om-15.35.37-768x380.png 768w, https:\/\/xojo.itbib4you.be\/wp-content\/uploads\/2025\/06\/Schermafbeelding-2025-06-21-om-15.35.37.png 1184w\" sizes=\"auto, (max-width: 709px) 85vw, (max-width: 909px) 67vw, (max-width: 1362px) 62vw, 840px\" \/><\/figure>\n<\/div>\n\n<div class=\"wp-block-image\">\n<figure class=\"alignleft size-full is-resized\"><img loading=\"lazy\" decoding=\"async\" width=\"474\" height=\"464\" src=\"https:\/\/xojo.itbib4you.be\/wp-content\/uploads\/2025\/06\/Schermafbeelding-2025-06-21-om-15.10.36.png\" alt=\"AccountWindow\" class=\"wp-image-571\" style=\"width:174px;height:auto\" srcset=\"https:\/\/xojo.itbib4you.be\/wp-content\/uploads\/2025\/06\/Schermafbeelding-2025-06-21-om-15.10.36.png 474w, https:\/\/xojo.itbib4you.be\/wp-content\/uploads\/2025\/06\/Schermafbeelding-2025-06-21-om-15.10.36-300x294.png 300w\" sizes=\"auto, (max-width: 474px) 85vw, 474px\" \/><\/figure>\n<\/div>\n\n\n<p>Xojo also offers the ability to add a toolbar to any window in the application. A toolbar can be added by selecting the <mark style=\"background-color:rgba(0, 0, 0, 0)\" class=\"has-inline-color has-bright-red-color\">Toolbar<\/mark> control in the library and adding it to your project. A <mark style=\"background-color:rgba(0, 0, 0, 0)\" class=\"has-inline-color has-bright-red-color\">Toolbar<\/mark> object (e.g. <mark style=\"background-color:rgba(0, 0, 0, 0)\" class=\"has-inline-color has-bright-blue-color\">Toolbar1<\/mark>) can then be dragged into a window. The name of the <mark style=\"background-color:rgba(0, 0, 0, 0)\" class=\"has-inline-color has-bright-red-color\">Toolbar<\/mark> object in <mark style=\"background-color:rgba(0, 0, 0, 0)\" class=\"has-inline-color has-bright-blue-color\">AccountWindow<\/mark> was then changed to <mark style=\"background-color:rgba(0, 0, 0, 0)\" class=\"has-inline-color has-bright-blue-color\">AccountToolbar<\/mark>.<\/p>\n\n\n\n<p><mark style=\"background-color:rgba(0, 0, 0, 0)\" class=\"has-inline-color has-bright-blue-color\">AccountToolbar<\/mark> can be edited afterwards with the <mark style=\"background-color:rgba(0, 0, 0, 0)\" class=\"has-inline-color has-bright-red-color\">Menu Editor<\/mark> to add buttons and menu items to the toolbar. However, it is also possible to construct a menu using code. This will be illustrated in this part of the lesson.<\/p>\n\n\n\n<p>The following code is available in the <mark style=\"background-color:rgba(0, 0, 0, 0)\" class=\"has-inline-color has-bright-red-color\">Opening<\/mark> event of <mark style=\"background-color:rgba(0, 0, 0, 0)\" class=\"has-inline-color has-bright-red-color\">AccountToolbar<\/mark>:<\/p>\n\n\n\n<pre class=\"wp-block-preformatted has-light-gray-background-color has-background has-small-font-size\"><mark style=\"background-color:rgba(0, 0, 0, 0)\" class=\"has-inline-color has-bright-red-color\">\/\/AccountToolbar Opening event<\/mark><br><mark style=\"background-color:rgba(0, 0, 0, 0)\" class=\"has-inline-color has-bright-blue-color\">Var<\/mark> accountsButton <mark style=\"background-color:rgba(0, 0, 0, 0)\" class=\"has-inline-color has-bright-blue-color\">As New<\/mark> DesktopToolbarButton<br>accountsButton.Caption = \"Accounts\"<br>accountsButton.Icon = image1<br>accountsButton.ButtonStyle = DesktopToolbarButton.ButtonStyles.DropDownMenu<br><br><mark style=\"background-color:rgba(0, 0, 0, 0)\" class=\"has-inline-color has-bright-blue-color\">Var<\/mark> accountsMenu <mark style=\"background-color:rgba(0, 0, 0, 0)\" class=\"has-inline-color has-bright-blue-color\">As New<\/mark> DesktopMenuItem<br>accountsMenu.AddMenu(<mark style=\"background-color:rgba(0, 0, 0, 0)\" class=\"has-inline-color has-bright-blue-color\">New<\/mark> DesktopMenuItem(\"CheckingAccount\"))<br>accountsMenu.AddMenu(<mark style=\"background-color:rgba(0, 0, 0, 0)\" class=\"has-inline-color has-bright-blue-color\">New<\/mark> DesktopMenuItem(\"RetirementAccount\"))<br>accountsMenu.AddMenu(<mark style=\"background-color:rgba(0, 0, 0, 0)\" class=\"has-inline-color has-bright-blue-color\">New<\/mark> DesktopMenuItem(\"SavingsAccount\"))<br><br>accountsButton.Menu = accountsMenu<br><br><mark style=\"background-color:rgba(0, 0, 0, 0)\" class=\"has-inline-color has-bright-blue-color\">Me<\/mark>.AddButton(accountsButton)<br><\/pre>\n\n\n\n<p>A toolbar consists of a series of buttons. A toolbar button can support one action or can support multiple actions through an underlying menu structure. In our example, we have one button that refers to the three types of accounts.<\/p>\n\n\n\n<p>In the first part of the code above, we create a toolbar button named <mark style=\"background-color:rgba(0, 0, 0, 0)\" class=\"has-inline-color has-bright-red-color\">accountsButton<\/mark> with the <mark style=\"background-color:rgba(0, 0, 0, 0)\" class=\"has-inline-color has-bright-red-color\">Caption<\/mark> <mark style=\"background-color:rgba(0, 0, 0, 0)\" class=\"has-inline-color has-bright-blue-color\">Accounts<\/mark> and with <mark style=\"background-color:rgba(0, 0, 0, 0)\" class=\"has-inline-color has-bright-blue-color\">image1<\/mark> as the <mark style=\"background-color:rgba(0, 0, 0, 0)\" class=\"has-inline-color has-bright-red-color\">Icon<\/mark>. <mark style=\"background-color:rgba(0, 0, 0, 0)\" class=\"has-inline-color has-bright-blue-color\">Image1<\/mark> is an image added to the project. The <mark style=\"background-color:rgba(0, 0, 0, 0)\" class=\"has-inline-color has-bright-red-color\">ButtonStyle<\/mark> is a <mark style=\"background-color:rgba(0, 0, 0, 0)\" class=\"has-inline-color has-bright-red-color\">DropDownMenu<\/mark>. Other button styles are <mark style=\"background-color:rgba(0, 0, 0, 0)\" class=\"has-inline-color has-bright-blue-color\">PushButton<\/mark>, <mark style=\"background-color:rgba(0, 0, 0, 0)\" class=\"has-inline-color has-bright-blue-color\">ToggleButton<\/mark>, <mark style=\"background-color:rgba(0, 0, 0, 0)\" class=\"has-inline-color has-bright-blue-color\">Space<\/mark>, <mark style=\"background-color:rgba(0, 0, 0, 0)\" class=\"has-inline-color has-bright-blue-color\">Flexible Space<\/mark> and so on.<\/p>\n\n\n\n<p>In the second part of the code, we create the underlying menu structure <mark style=\"background-color:rgba(0, 0, 0, 0)\" class=\"has-inline-color has-bright-red-color\">accountsMenu<\/mark> consisting of three menu items: <mark style=\"background-color:rgba(0, 0, 0, 0)\" class=\"has-inline-color has-bright-blue-color\">CheckingAccount<\/mark>, <mark style=\"background-color:rgba(0, 0, 0, 0)\" class=\"has-inline-color has-bright-blue-color\">RetirementAccount<\/mark> and <mark style=\"background-color:rgba(0, 0, 0, 0)\" class=\"has-inline-color has-bright-blue-color\">SavingsAccount<\/mark>. Menu items are always objects of the class <mark style=\"background-color:rgba(0, 0, 0, 0)\" class=\"has-inline-color has-bright-red-color\">DesktopMenuItem<\/mark>.<\/p>\n\n\n\n<pre class=\"wp-block-preformatted has-yellow-background-color has-background\">The <mark style=\"background-color:rgba(0, 0, 0, 0)\" class=\"has-inline-color has-bright-red-color\">AddMenu<\/mark> method adds a DesktopMenuItem to a DesktopMenuItem menu.<\/pre>\n\n\n\n<p>In the third part of the code, we define the menu (<mark style=\"background-color:rgba(0, 0, 0, 0)\" class=\"has-inline-color has-bright-blue-color\">accountsMenu<\/mark>) as a dropdown menu of <mark style=\"background-color:rgba(0, 0, 0, 0)\" class=\"has-inline-color has-bright-blue-color\">accountsButton<\/mark>.<\/p>\n\n\n\n<pre class=\"wp-block-preformatted has-yellow-background-color has-background\">The <mark style=\"background-color:rgba(0, 0, 0, 0)\" class=\"has-inline-color has-bright-red-color\">Menu<\/mark> property of a <mark style=\"background-color:rgba(0, 0, 0, 0)\" class=\"has-inline-color has-bright-red-color\">DesktopToolbarButton<\/mark> is used to assign a dropdown menu.<\/pre>\n\n\n\n<p>In the fourth part of the code, we add the button (<mark style=\"background-color:rgba(0, 0, 0, 0)\" class=\"has-inline-color has-bright-blue-color\">accountsButton<\/mark>) to the <mark style=\"background-color:rgba(0, 0, 0, 0)\" class=\"has-inline-color has-bright-blue-color\">AccountToolbar<\/mark> (<mark style=\"background-color:rgba(0, 0, 0, 0)\" class=\"has-inline-color has-bright-blue-color\">Me<\/mark> refers to the object to which the Opening event applies).<\/p>\n\n\n\n<pre class=\"wp-block-preformatted has-yellow-background-color has-background\">The <mark style=\"background-color:rgba(0, 0, 0, 0)\" class=\"has-inline-color has-bright-red-color\">AddButton<\/mark> method is used to add a <mark style=\"background-color:rgba(0, 0, 0, 0)\" class=\"has-inline-color has-bright-red-color\">DesktopToolbarButton<\/mark>to a toolbar.<\/pre>\n\n\n\n<h3 class=\"wp-block-heading\">How to handle a selection?<\/h3>\n\n\n\n<p>The <mark style=\"background-color:rgba(0, 0, 0, 0)\" class=\"has-inline-color has-bright-red-color\">MenuItemSelected<\/mark> event of <mark style=\"background-color:rgba(0, 0, 0, 0)\" class=\"has-inline-color has-bright-blue-color\">AccountToolbar<\/mark> is available to handle a selection of a dropdown menu item. The local variable <mark style=\"background-color:rgba(0, 0, 0, 0)\" class=\"has-inline-color has-bright-blue-color\">selectedItem<\/mark> (parameter of the event named <mark style=\"background-color:rgba(0, 0, 0, 0)\" class=\"has-inline-color has-bright-red-color\">MenuItemSelected<\/mark>) refers to the selected item. The <mark style=\"background-color:rgba(0, 0, 0, 0)\" class=\"has-inline-color has-bright-red-color\">Text<\/mark> property of <mark style=\"background-color:rgba(0, 0, 0, 0)\" class=\"has-inline-color has-bright-blue-color\">selectedItem<\/mark> contains the text shown in the menu. This is the code used:<\/p>\n\n\n\n<pre class=\"wp-block-preformatted has-light-gray-background-color has-background has-small-font-size\"><mark style=\"background-color:rgba(0, 0, 0, 0)\" class=\"has-inline-color has-bright-red-color\">\/\/MenuItemSelected(item As DesktopToolbarItem, selectedItem As DesktopMenuItem)<\/mark><br>SelectedMenuItem = selectedItem.Text<br>ProcessSelection<\/pre>\n\n\n\n<p>The property <mark style=\"background-color:rgba(0, 0, 0, 0)\" class=\"has-inline-color has-bright-red-color\">selectedMenuItem<\/mark> receives the text of the item that was selected in the menu. As you may recall from the discussion of the MenuBar menu, further processing is done by the method called <mark style=\"background-color:rgba(0, 0, 0, 0)\" class=\"has-inline-color has-bright-red-color\">ProcessSelection<\/mark>. Our program still works fully, but now with the Toolbar menu.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\">Contextual Menu<\/h2>\n\n\n\n<figure class=\"wp-block-image size-large\"><img loading=\"lazy\" decoding=\"async\" width=\"1024\" height=\"559\" src=\"https:\/\/xojo.itbib4you.be\/wp-content\/uploads\/2025\/06\/Schermafbeelding-2025-06-22-om-14.24.42-1024x559.png\" alt=\"contextual menu\" class=\"wp-image-584\" srcset=\"https:\/\/xojo.itbib4you.be\/wp-content\/uploads\/2025\/06\/Schermafbeelding-2025-06-22-om-14.24.42-1024x559.png 1024w, https:\/\/xojo.itbib4you.be\/wp-content\/uploads\/2025\/06\/Schermafbeelding-2025-06-22-om-14.24.42-300x164.png 300w, https:\/\/xojo.itbib4you.be\/wp-content\/uploads\/2025\/06\/Schermafbeelding-2025-06-22-om-14.24.42-768x419.png 768w, https:\/\/xojo.itbib4you.be\/wp-content\/uploads\/2025\/06\/Schermafbeelding-2025-06-22-om-14.24.42.png 1198w\" sizes=\"auto, (max-width: 709px) 85vw, (max-width: 909px) 67vw, (max-width: 1362px) 62vw, 840px\" \/><\/figure>\n\n\n\n<p>A <mark style=\"background-color:rgba(0, 0, 0, 0)\" class=\"has-inline-color has-bright-red-color\">Contextual menu<\/mark> appears when a user <mark style=\"background-color:rgba(0, 0, 0, 0)\" class=\"has-inline-color has-bright-blue-color\">right-clicks<\/mark> on a control. In the screenshot above, the user has called up a contextual menu related to the DesktopListBox control. <\/p>\n\n\n\n<h3 class=\"wp-block-heading\">How to create a Contextual menu?<\/h3>\n\n\n<div class=\"wp-block-image\">\n<figure class=\"alignleft size-full is-resized\"><img loading=\"lazy\" decoding=\"async\" width=\"496\" height=\"466\" src=\"https:\/\/xojo.itbib4you.be\/wp-content\/uploads\/2025\/06\/Schermafbeelding-2025-06-22-om-14.23.58.png\" alt=\"TransactionList\" class=\"wp-image-585\" style=\"width:174px\" srcset=\"https:\/\/xojo.itbib4you.be\/wp-content\/uploads\/2025\/06\/Schermafbeelding-2025-06-22-om-14.23.58.png 496w, https:\/\/xojo.itbib4you.be\/wp-content\/uploads\/2025\/06\/Schermafbeelding-2025-06-22-om-14.23.58-300x282.png 300w\" sizes=\"auto, (max-width: 496px) 85vw, 496px\" \/><\/figure>\n<\/div>\n\n\n<p>A contextual menu can be created via an <mark style=\"background-color:rgba(0, 0, 0, 0)\" class=\"has-inline-color has-bright-red-color\">event<\/mark> called <mark style=\"background-color:rgba(0, 0, 0, 0)\" class=\"has-inline-color has-bright-red-color\">ConstructContextualMenu<\/mark>. This event can be selected via our DesktopListBox named <mark style=\"background-color:rgba(0, 0, 0, 0)\" class=\"has-inline-color has-bright-red-color\">TransactionList<\/mark> .<\/p>\n\n\n\n<div style=\"height:4px\" aria-hidden=\"true\" class=\"wp-block-spacer\"><\/div>\n\n\n\n<p>The following piece of code was added to the event <mark style=\"background-color:rgba(0, 0, 0, 0)\" class=\"has-inline-color has-bright-red-color\">ConstructContextualMenu<\/mark>:<\/p>\n\n\n\n<pre class=\"wp-block-preformatted has-light-gray-background-color has-background has-small-font-size\"><mark style=\"background-color:rgba(0, 0, 0, 0)\" class=\"has-inline-color has-bright-blue-color\">\/<\/mark><mark style=\"background-color:rgba(0, 0, 0, 0)\" class=\"has-inline-color has-bright-red-color\">\/ConstructContextualMenu(base As DesktopMenuItem, x As Integer, y As Integer) As Boolean<\/mark><br>base.AddMenu(<mark style=\"background-color:rgba(0, 0, 0, 0)\" class=\"has-inline-color has-bright-blue-color\">New<\/mark> DesktopMenuItem(\"Sort Deposit column\"))<br>base.AddMenu(<mark style=\"background-color:rgba(0, 0, 0, 0)\" class=\"has-inline-color has-bright-blue-color\">New<\/mark> DesktopMenuItem(\"Sort Withdraw column\"))<br><mark style=\"background-color:rgba(0, 0, 0, 0)\" class=\"has-inline-color has-bright-blue-color\">Return True<\/mark><\/pre>\n\n\n\n<p>In the code above, <mark style=\"background-color:rgba(0, 0, 0, 0)\" class=\"has-inline-color has-bright-red-color\">DesktopMenuItems<\/mark> are added with the <mark style=\"background-color:rgba(0, 0, 0, 0)\" class=\"has-inline-color has-bright-red-color\">AddMenu<\/mark> method to the <mark style=\"background-color:rgba(0, 0, 0, 0)\" class=\"has-inline-color has-bright-red-color\">DesktopMenuItem<\/mark> parameter <mark style=\"background-color:rgba(0, 0, 0, 0)\" class=\"has-inline-color has-bright-blue-color\">base<\/mark>. <mark style=\"background-color:rgba(0, 0, 0, 0)\" class=\"has-inline-color has-bright-blue-color\">base<\/mark> is a parameter of the event <mark style=\"background-color:rgba(0, 0, 0, 0)\" class=\"has-inline-color has-bright-red-color\">ConstructContextualMenu<\/mark> and is the initial menu object. All items added to <mark style=\"background-color:rgba(0, 0, 0, 0)\" class=\"has-inline-color has-bright-blue-color\">base<\/mark> will be displayed.<\/p>\n\n\n\n<h3 class=\"wp-block-heading\">How to handle a selection?<\/h3>\n\n\n\n<p>The event <mark style=\"background-color:rgba(0, 0, 0, 0)\" class=\"has-inline-color has-bright-red-color\">ContextualMenuItemSelected<\/mark> will be triggered by the selection of an item in a contextual menu. The <mark style=\"background-color:rgba(0, 0, 0, 0)\" class=\"has-inline-color has-bright-red-color\">Text<\/mark> property of <mark style=\"background-color:rgba(0, 0, 0, 0)\" class=\"has-inline-color has-bright-blue-color\">selectedItem<\/mark> (parameter of the <mark style=\"background-color:rgba(0, 0, 0, 0)\" class=\"has-inline-color has-bright-red-color\">ContextualMenuItemSelected<\/mark> event) contains the text displayed in the selected item.<\/p>\n\n\n\n<pre class=\"wp-block-preformatted has-light-gray-background-color has-background has-small-font-size\"><mark style=\"background-color:rgba(0, 0, 0, 0)\" class=\"has-inline-color has-bright-red-color\">\/\/ContextualMenuItemSelected(selectedItem As DesktopMenuItem) As Boolean<\/mark><br><mark style=\"background-color:rgba(0, 0, 0, 0)\" class=\"has-inline-color has-bright-blue-color\">Select Case<\/mark> selectedItem.Text<br><mark style=\"background-color:rgba(0, 0, 0, 0)\" class=\"has-inline-color has-bright-blue-color\">Case<\/mark> \"Sort Deposit column\"<br>  <mark style=\"background-color:rgba(0, 0, 0, 0)\" class=\"has-inline-color has-bright-blue-color\">Me<\/mark>.ColumnSortDirectionAt(1) = DesktopListBox.SortDirections.Descending<br>  <mark style=\"background-color:rgba(0, 0, 0, 0)\" class=\"has-inline-color has-bright-blue-color\">Me<\/mark>.SortingColumn = 1<br>  <mark style=\"background-color:rgba(0, 0, 0, 0)\" class=\"has-inline-color has-bright-blue-color\">Me<\/mark>.Sort<br><mark style=\"background-color:rgba(0, 0, 0, 0)\" class=\"has-inline-color has-bright-blue-color\">Case<\/mark> \"Sort Withdraw column\"<br>  <mark style=\"background-color:rgba(0, 0, 0, 0)\" class=\"has-inline-color has-bright-blue-color\">Me<\/mark>.ColumnSortDirectionAt(2) = DesktopListBox.SortDirections.Descending<br>  <mark style=\"background-color:rgba(0, 0, 0, 0)\" class=\"has-inline-color has-bright-blue-color\">Me<\/mark>.SortingColumn = 2<br>  <mark style=\"background-color:rgba(0, 0, 0, 0)\" class=\"has-inline-color has-bright-blue-color\">Me<\/mark>.Sort<br><mark style=\"background-color:rgba(0, 0, 0, 0)\" class=\"has-inline-color has-bright-blue-color\">End Select<\/mark><br><mark style=\"background-color:rgba(0, 0, 0, 0)\" class=\"has-inline-color has-bright-blue-color\">Return True<\/mark><\/pre>\n\n\n\n<p>To sort a column in a Listbox, the column number must be defined via the <mark style=\"background-color:rgba(0, 0, 0, 0)\" class=\"has-inline-color has-bright-red-color\">SortingColumn<\/mark> property and the sorting order (<mark style=\"background-color:rgba(0, 0, 0, 0)\" class=\"has-inline-color has-bright-blue-color\">Descending<\/mark> or <mark style=\"background-color:rgba(0, 0, 0, 0)\" class=\"has-inline-color has-bright-blue-color\">Ascending<\/mark>) via the <mark style=\"background-color:rgba(0, 0, 0, 0)\" class=\"has-inline-color has-bright-red-color\">ColumnSortDirectionAt<\/mark> method. The sorting itself is done by the method <mark style=\"background-color:rgba(0, 0, 0, 0)\" class=\"has-inline-color has-bright-red-color\">Sort<\/mark> .<\/p>\n\n\n\n<figure class=\"wp-block-table has-small-font-size\"><table class=\"has-fixed-layout\"><thead><tr><th>Property<\/th><th>Type<\/th><th>Description<\/th><\/tr><\/thead><tbody><tr><td>SortingColumn<\/td><td>Integer<\/td><td>The column of the ListBox to be sorted<\/td><\/tr><\/tbody><\/table><figcaption class=\"wp-element-caption\">DesktopListBox properties<\/figcaption><\/figure>\n\n\n\n<figure class=\"wp-block-table has-small-font-size\"><table class=\"has-fixed-layout\"><thead><tr><th>Method<\/th><th>Type<\/th><th>Description<\/th><\/tr><\/thead><tbody><tr><td>ColumnSortDirectionAt<\/td><td>Integer<\/td><td>Assigns a sort direction to the specified column (ascending\/descending)<\/td><\/tr><tr><td>Sort<\/td><td><\/td><td>Sorts the ListBox based on the values assigned to ColumnSortDirectionAt and SortingColumn<\/td><\/tr><\/tbody><\/table><figcaption class=\"wp-element-caption\">DesktopListBox methods<\/figcaption><\/figure>\n\n\n\n<pre class=\"wp-block-preformatted has-yellow-background-color has-background\">Column numbers of a DesktopListBox begin at zero (<mark style=\"background-color:rgba(0, 0, 0, 0)\" class=\"has-inline-color has-bright-red-color\">0<\/mark>).<\/pre>\n\n\n\n<p><\/p>\n","protected":false},"excerpt":{"rendered":"<p>Introduction Apps use menus to give users access to the available actions offered by the application. In Xojo, you can use three different types of menus: MenuBar menus, Toolbar menus and Contextual menus. This lesson discusses the use of these three types applied to our Account example. MenuBar menu Create a menu with the Menu &hellip; <a href=\"https:\/\/xojo.itbib4you.be\/index.php\/xojo-menus\/\" class=\"more-link\">Continue reading<span class=\"screen-reader-text\"> &#8220;Xojo Menus&#8221;<\/span><\/a><\/p>\n","protected":false},"author":1,"featured_media":0,"parent":0,"menu_order":0,"comment_status":"closed","ping_status":"closed","template":"","meta":{"footnotes":""},"class_list":["post-515","page","type-page","status-publish","hentry"],"_links":{"self":[{"href":"https:\/\/xojo.itbib4you.be\/index.php\/wp-json\/wp\/v2\/pages\/515","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/xojo.itbib4you.be\/index.php\/wp-json\/wp\/v2\/pages"}],"about":[{"href":"https:\/\/xojo.itbib4you.be\/index.php\/wp-json\/wp\/v2\/types\/page"}],"author":[{"embeddable":true,"href":"https:\/\/xojo.itbib4you.be\/index.php\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/xojo.itbib4you.be\/index.php\/wp-json\/wp\/v2\/comments?post=515"}],"version-history":[{"count":68,"href":"https:\/\/xojo.itbib4you.be\/index.php\/wp-json\/wp\/v2\/pages\/515\/revisions"}],"predecessor-version":[{"id":614,"href":"https:\/\/xojo.itbib4you.be\/index.php\/wp-json\/wp\/v2\/pages\/515\/revisions\/614"}],"wp:attachment":[{"href":"https:\/\/xojo.itbib4you.be\/index.php\/wp-json\/wp\/v2\/media?parent=515"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}