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
};
xtd::forms::application::run
(form);
}
xtd::forms::application::run
static void run()
Begins running a standard application message loop on the current thread, without a form.
xtd::forms::button::create
static button create()
A factory to create an xtd::forms::button.
xtd::forms::control::click
event< control, event_handler > click
Occurs when the xtd::forms::control is clicked.
Definition
control.h:1485
xtd::forms::form::close
void close()
Closes the form.
xtd::forms::form::create
static form create()
A factory to create an xtd::forms::form.
xtd::forms::message_box::show
static dialog_result show()
Displays a message box.
xtd::forms::message_dialog_icon::question
@ question
The message box contains a symbol consisting of a question mark in a circle. The question-mark messag...
xtd::forms::dialog_result::no
@ no
The dialog box return value is No (usually sent from a button labeled No).
xtd::forms::message_dialog_buttons::yes_no
@ yes_no
The message box contains Yes and No buttons.
Generated on Sun Nov 17 2024 19:43:50 for xtd by
Gammasoft
. All rights reserved.