The following code example demonstrate the use of main_menu::create_standard_items factory.
#include <xtd/xtd>
namespace examples {
class form1 : public form {
public:
form1() {
text("Main menu create standard items example");
list_box1.items().push_back(
ustring::format(
"{} clicked", as<menu_item&>(sender).text()));
list_box1.selected_index(list_box1.items().size() - 1);
}));
list_box1.parent(*this);
}
private:
list_box list_box1;
};
}
int main() {
}
static xtd::forms::main_menu create_standard_items(const xtd::event_handler &on_click)
A factory to create a main menu with specified on click event handler.
static xtd::ustring exit()
Gets a system-defined text that has a string value of "E&xit". This field is constant.
@ menu
The system-defined color of a menu's background.
The xtd namespace contains all fundamental classes to access Hardware, Os, System,...
Definition: system_report.h:17