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

demonstrates the use of xtd::forms::message_dialog dialog.

Windows

macOS

Gnome

#include <xtd/forms/application>
#include <xtd/forms/button>
#include <xtd/forms/form>
#include <xtd/forms/label>
#include <xtd/forms/message_dialog>
using namespace xtd;
using namespace xtd::forms;
class form1 : public form {
public:
form1() {
controls().push_back_range({button_show_message, label_dialog_result});
location({400, 200});
start_position(form_start_position::manual);
text("Message dialog (show sheet) exemple");
button_show_message.location({10, 10});
button_show_message.text("Message...");
button_show_message.width(100);
button_show_message.click += [&] {
label_dialog_result.text("");
dialog.show_sheet(*this);
};
label_dialog_result.location({10, 45});
label_dialog_result.width(200);
dialog.text("Message");
dialog.message("Hello, World!");
dialog.dialog_closed += [&](object & sender, const dialog_closed_event_args & e) {
label_dialog_result.text(string::format("dialog_result = {}", e.dialog_result()));
};
}
private:
button button_show_message;
label label_dialog_result;
};
auto main() -> int {
application::run(form1 {});
}
Represents a Windows button control.
Definition button.h:49
Provides data for a dialog closed event.
Definition dialog_closed_event_args.h:22
Represents a window or dialog box that makes up an application's user interface.
Definition form.h:54
Represents a standard Windows label.
Definition label.h:38
Displays a message window, also known as a dialog box, which presents a message to the user....
Definition message_dialog.h:42
@ warning
The message box contains a symbol consisting of an exclamation point in a triangle with a yellow back...
@ ok_cancel
The message box contains OK and Cancel buttons.
The xtd::forms namespace contains classes for creating Windows-based applications that take full adva...
Definition xtd_about_box.h:12
The xtd namespace contains all fundamental classes to access Hardware, Os, System,...
Definition xtd_about_box.h:10