xtd 0.2.0
Loading...
Searching...
No Matches
form2.cpp

represents a window or dialog box that makes up an application's user interface.

Windows

macOS

Gnome

#include <xtd/forms/application>
#include <xtd/forms/button>
#include <xtd/forms/form>
#include <xtd/forms/message_box>
auto main() -> int {
auto form = xtd::forms::form::create("form1");
form.form_closing += [](auto & sender, auto & event) {event.cancel(xtd::forms::message_box::show("Are you sure you want exit?", "Close Form", xtd::forms::message_box_buttons::yes_no, xtd::forms::message_box_icon::question) == xtd::forms::dialog_result::no);};
auto button_close = xtd::forms::button::create(form, "Close", {10, 10});
button_close.click += {form, &xtd::forms::form::close};
}
static void run()
Begins running a standard application message loop on the current thread, without a form.
static button create()
A factory to create an xtd::forms::button.
event< control, event_handler > click
Occurs when the xtd::forms::control is clicked.
Definition control.hpp:1485
void close()
Closes the form.
static form create()
A factory to create an xtd::forms::form.
static dialog_result show()
Displays a message box.
@ question
The message box contains a symbol consisting of a question mark in a circle. The question-mark messag...
@ no
The dialog box return value is No (usually sent from a button labeled No).
@ yes_no
The message box contains Yes and No buttons.