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

demonstrates the use of form event.

Windows

macOS

Gnome

#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, string::format("The form is clicked at {}", e.location()), "form_click");
};
application::run(form);
}
virtual const xtd::string & text() const noexcept
Gets the text associated with this control.
event< control, mouse_event_handler > mouse_click
Occurs when the xtd::forms::control is clicked by the mouse.
Definition control.h:1669
Represents a window or dialog box that makes up an application's user interface.
Definition form.h:54
Provides data for the xtd::forms::control::mouse_up, xtd::forms::control::mouse_down,...
Definition mouse_event_args.h:34
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