xtd 0.2.0
form_click.cpp

demonstrates the use of form event.

Windows
form_click_w.png

form_click_wd.png
macOS
form_click_m.png

form_click_md.png
Gnome
form_click_g.png

form_click_gd.png
#include <xtd/forms/application>
#include <xtd/forms/form>
#include <xtd/forms/message_box>
using namespace xtd;
using namespace xtd::forms;
auto main()->int {
form.text("Click anywhere on the form");
form.mouse_click += [&](object& sender, const mouse_event_args& e) {
if (e.button() == mouse_buttons::left)
message_box::show(form, ustring::format("The form is clicked at {}", e.location()), "form_click");
};
}