xtd - Reference Guide 0.2.0
exception_box.cpp

The following code example demonstrates the use of exception_dialog dialog.

Windows
exception_box_w.png

exception_box_wd.png
macOS
exception_box_m.png

exception_box_md.png
Gnome
exception_box_g.png

exception_box_gd.png
#include <xtd/xtd>
using namespace xtd;
using namespace xtd::forms;
class form1 : public form {
public:
form1() {
text("Exception box example");
controls().push_back(button1);
button1.location({10, 10});
button1.auto_size(true);
button1.text("Exception...");
button1.click += [&] {
try {
throw invalid_operation_exception("Throws an invalid operation exception to show an exception dialog.", current_stack_frame_);
} catch (const xtd::system_exception& e) {
}
};
}
private:
};
int main() {
application::run(form1 {});
}