xtd 0.2.0
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:1495
void close()
Closes the form.
static form create()
A factory to create an xtd::forms::form.
static dialog_result show(const iwin32_window &owner)
Displays a message box in front of the specified window.
@ question
The message box contains a symbol consisting of a question mark in a circle. The question-mark messag...
Definition message_dialog_icon.hpp:28
@ no
The dialog box return value is No (usually sent from a button labeled No).
Definition dialog_result.hpp:59
@ yes_no
The message box contains Yes and No buttons.
Definition message_dialog_buttons.hpp:32