Skip to content

Commit

Permalink
Update menus_and_toolbars.md
Browse files Browse the repository at this point in the history
  • Loading branch information
gammasoft71 committed May 22, 2024
1 parent f952350 commit 5a0de4b
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions docs/documentation/eBook/menus_and_toolbars.md
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ To implement a [menu](https://gammasoft71.github.io/xtd/reference_guides/latest/

Creating a [menu](https://gammasoft71.github.io/xtd/reference_guides/latest/classxtd_1_1forms_1_1form.html#a9b34052d185a980f1fa5b9d2929f241c) in xtd is very simple.

```c++
```cpp
#include <xtd/xtd>

using namespace xtd;
Expand Down Expand Up @@ -44,7 +44,7 @@ auto main() -> int {
}
```
```c++
```cpp
menu_item file_exit_menu_item {"&Quit", {*this, &form1::on_exit}, shortcut::alt_f4};
```

Expand All @@ -53,14 +53,14 @@ The second parameter is the event handler associated with the menu item.
The third parameter is the shortcut key for calling the menu item from the keyboard.
The `&` character creates an accelerator key. The character that follows the `&` is underlined.

```c++
```cpp
menu_item file_menu_item {"&File", {file_exit_menu_item}};
```
We create the submenu item in the file with the menu item text as the first parameter.
The second parameter is a vector of menu items. In this case, it contains only the exit menu item.
```c++
```cpp
main_menu main_menu1 {file_menu_item};
```

Expand Down

0 comments on commit 5a0de4b

Please sign in to comment.