demonstrates how to use startup_ keyword.
#include <xtd/forms/application>
#include <xtd/forms/button>
#include <xtd/forms/form>
#include <xtd/forms/message_box>
#include <xtd/startup>
namespace form_and_main_example {
class form_main :
public form {
public:
static auto main() {
application::run(form_main());
}
form_main() {
text("form main");
location({300, 200});
e.cancel(message_box::show("Are you sure you want exit?", "Close form", message_box_buttons::yes_no, message_box_icon::question) == dialog_result::no);
};
}
private:
};
}
startup_(form_and_main_example::form_main::main);
generic_event_handler<> event_handler
Represents the method that will handle an event that has no event data.
Definition event_handler.h:32
#define startup_(main_method)
Defines the entry point to be called when the application loads. Generally this is set either to the ...
Definition startup.h:175
size_t size
Represents a size of any object in bytes.
Definition size.h:23
The xtd namespace contains all fundamental classes to access Hardware, Os, System,...
Definition xtd_about_box.h:10