xtd - Reference Guide  0.1.1
Modern c++17/20 framework to create console, GUI and unit test applications on Windows, macOS, Linux, iOS and android.
message_dialog.cpp

The following code example demonstrate the use of message_dialog dialog.

Windows

macOS

Gnome

#include <xtd/xtd>
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 exemple");
button_show_message.location({10, 10});
button_show_message.text("Message...");
button_show_message.width(100);
button_show_message.click += [&] {
message_dialog dialog;
dialog.message("Hello, World!");
dialog.text("Message");
label_dialog_result.text(ustring::format("dialog_result = {}", dialog.show_sheet_dialog(*this)));
};
label_dialog_result.location({10, 45});
label_dialog_result.width(200);
}
private:
button button_show_message;
label label_dialog_result;
};
int main() {
application::run(form1());
}
static void run()
Begins running a standard application message loop on the current thread, without a form.
static ustring format(const ustring &fmt, args_t &&... args)
Writes the text representation of the specified arguments list, to string using the specified format ...
Definition: ustring.h:689
@ warning
The message box contains a symbol consisting of an exclamation point in a triangle with a yellow back...
@ location
Specifies that both the x and y coordinates of the control are defined.
@ ok_cancel
The message box contains OK and Cancel buttons.
@ manual
The position of the form is determined by the Location property.
@ button
The appearance of a button.
The xtd::forms namespace contains classes for creating Windows-based applications that take full adva...
Definition: about_box.h:13
The xtd namespace contains all fundamental classes to access Hardware, Os, System,...
Definition: system_report.h:17