xtd
1.0.0
Toggle main menu visibility
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 +=
delegate_
(
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 auto run() -> void
Begins running a standard application message loop on the current thread, without a form.
xtd::forms::button::create
static auto create() -> button
A factory to create an xtd::forms::button.
xtd::forms::form::create
static auto create() -> form
A factory to create an xtd::forms::form.
xtd::forms::form::close
auto close() -> void
Closes the form.
xtd::forms::message_box::show
static auto show(const xtd::forms::iwin32_window &owner) -> xtd::forms::dialog_result
Displays a message box in front of the specified window.
delegate_
#define delegate_
The declaration of a delegate type is similar to a method signature. It has a return value and any nu...
Definition
delegate.hpp:1018
xtd::forms::dialog_result::no
@ no
The dialog box return value is No (usually sent from a button labeled No).
Definition
dialog_result.hpp:59
Generated on
for xtd by
Gammasoft
. All rights reserved.