xtd - Reference Guide  0.2.0
Modern c++17/20 framework to create console, GUI and unit test applications on Windows, macOS, Linux, iOS and android.
Classes | Typedefs
events

Definition

events are event args and event handler needed to response to window messages.

Classes

class  xtd::console_cancel_event_args
 Provides data for the console::cancel_key_press event. This class cannot be inherited. More...
 
class  xtd::diagnostics::data_received_event_args
 Provides data for the xtd::diagnostics::process::output_data_received and xtd::diagnostics::process::error_data_received events. More...
 
class  xtd::diagnostics::process::error_data_received_event
 Represents a process error data received event. More...
 
class  xtd::diagnostics::process::exit_event
 Represents a process exit event. More...
 
class  xtd::diagnostics::process::output_data_received_event
 Represents a process output data received event. More...
 
class  xtd::event< object_t, handler_t >
 Represents an event. More...
 
class  xtd::event_args
 Represents the base class for classes that contain event data, and provides a value to use for events that do not include event data. More...
 
class  xtd::forms::animation_updated_event_args
 Provides data for the animation update event. More...
 
class  xtd::forms::cancel_event_args
 Provides data for a cancelable event. More...
 
class  xtd::forms::control_event_args
 Provides data for the control_added and control_removed events. More...
 
class  xtd::forms::dialog_closed_event_args
 Provides data for a dialog closed event. More...
 
class  xtd::forms::do_work_event_args
 Provides data for the do_work event handler. More...
 
class  xtd::forms::form_closed_event_args
 Provides data for the form_closed event. More...
 
class  xtd::forms::form_closing_event_args
 Provides data for the form_closing event. More...
 
class  xtd::forms::help_event_args
 Provides data for the control_added and control_removed events. More...
 
class  xtd::forms::item_check_event_args
 Provides data for the item_check event of the checked_list_box and list_view controls. More...
 
class  xtd::forms::key_event_args
 Provides data for the key_down or key_up event. More...
 
class  xtd::forms::key_press_event_args
 Provides data for the key_press event. More...
 
class  xtd::forms::mouse_event_args
 Provides data for the xtd::forms::control::mouse_up, xtd::forms::control::mouse_down, and xtd::forms::control::mouse_move events. More...
 
class  xtd::forms::paint_event_args
 Provides data for the paint event. More...
 
class  xtd::forms::progress_changed_event_args
 Provides data for the do_work event handler. More...
 
class  xtd::forms::run_worker_completed_event_args
 Provides data for the do_work event handler. More...
 
class  xtd::tunit::class_event_args
 Provides data for the xtd::tunit::class_test events. More...
 
class  xtd::tunit::test_event_args
 Provides data for the xtd::tunit::test events. More...
 
class  xtd::tunit::tunit_event_args
 tunit_event_args is the base class for classes containing event data. More...
 

Typedefs

using xtd::forms::animation_updated_event_handler = xtd::delegate< void(object &, const xtd::forms::animation_updated_event_args &)>
 Represents the method that will handle the update of xtd::forms::animation. More...
 
using xtd::forms::cancel_event_handler = delegate< void(object &sender, cancel_event_args &e)>
 Represents the method that handles a cancelable event. More...
 
using xtd::console_cancel_event_handler = xtd::delegate< void(console_cancel_event_args &)>
 Represents the method that will handle the cancel_key_press event of a xtd::console. More...
 
using xtd::forms::control_event_handler = delegate< void(object &sender, const control_event_args &e)>
 Represents the method that will handle the control_added and control_removed events of the control class. More...
 
using xtd::diagnostics::data_received_event_handler = xtd::delegate< void(xtd::object &sender, const xtd::diagnostics::data_received_event_args &e)>
 Represents the method that will handle the xtd::diagnostics::process::output_data_received and xtd::diagnostics::process::error_data_received event of a Process. More...
 
using xtd::forms::dialog_closed_event_handler = delegate< void(object &sender, const dialog_closed_event_args &e)>
 Provides handler for a dialog closed event. More...
 
using xtd::forms::do_work_event_handler = delegate< void(object &sender, do_work_event_args &e)>
 Represents the method that will handle the do_work event. This class cannot be inherited. More...
 
using xtd::event_handler = generic_event_handler<>
 Represents the method that will handle an event that has no event data. More...
 
using xtd::forms::form_closed_event_handler = delegate< void(object &sender, const form_closed_event_args &e)>
 Represents the method that handles a form_closed event. More...
 
using xtd::forms::form_closing_event_handler = delegate< void(object &sender, form_closing_event_args &e)>
 Represents the method that handles a form_closing event. More...
 
template<typename event_args_t = const xtd::event_args&>
using xtd::generic_event_handler = xtd::delegate< void(xtd::object &sender, event_args_t e)>
 Represents the method that will handle an event when the event provides data. More...
 
using xtd::forms::help_event_handler = delegate< void(object &sender, help_event_args &e)>
 Represents the method that will handle the help_requested event of a control. More...
 
using xtd::forms::item_check_event_handler = delegate< void(object &sender, item_check_event_args &e)>
 Represents the method that will handle the ItemCheck event of a CheckedListBox or ListView control. More...
 
using xtd::forms::key_event_handler = delegate< void(object &sender, key_event_args &e)>
 Represents the method that will handle the key_up or key_down event of a control. More...
 
using xtd::forms::key_press_event_handler = delegate< void(object &sender, key_press_event_args &e)>
 Represents the method that will handle the key_press event of a control. More...
 
using xtd::forms::message_loop_callback = delegate< bool()>
 Represents a method that will check whether the hosting environment is still sending messages. More...
 
using xtd::forms::mouse_event_handler = delegate< void(object &sender, const mouse_event_args &e)>
 Represents the method that will handle the MouseDown, MouseUp, or MouseMove event of a form, control, or other component. More...
 
using xtd::forms::paint_event_handler = delegate< void(object &sender, paint_event_args &e)>
 Represents the method that will handle the paint event of a control. More...
 
using xtd::forms::progress_changed_event_handler = delegate< void(object &sender, const progress_changed_event_args &e)>
 Represents the method that will handle the do_work event. This class cannot be inherited. More...
 
using xtd::forms::run_worker_completed_event_handler = delegate< void(object &sender, const run_worker_completed_event_args &e)>
 Represents the method that will handle the do_work event. This class cannot be inherited. More...
 

Events

xtd::event< animation, animation_updated_event_handlerxtd::forms::animation::updated
 Occurs when the specified interval specified by xtd::animation::frames_per_seconds has elapsed and the animation is started. More...
 

Events

static event< application, delegate< void(const event_args &)> > xtd::forms::application::application_exit
 Occurs when the application is about to shut down. More...
 
static event< application, delegate< void(const event_args &)> > xtd::forms::application::enter_thread_modal
 Occurs when the application is about to enter a modal state. More...
 
static event< application, delegate< void(const event_args &)> > xtd::forms::application::idle
 Occurs when the application finishes processing and is about to enter the idle state. More...
 
static event< application, delegate< void(const event_args &)> > xtd::forms::application::leave_thread_modal
 Occurs when the application is about to leave a modal state. More...
 
static event< application, delegate< void(const event_args &)> > xtd::forms::application::thread_exit
 Occurs when a thread is about to shut down. When the main thread for an application is about to be shut down, this event is raised first, followed by an application_exit event. More...
 

Events

event< application_context, event_handlerxtd::forms::application_context::thread_exit
 Occurs when the message loop of the thread should be terminated, by calling exit_thread(). More...
 

Events

event< background_worker, do_work_event_handlerxtd::forms::background_worker::do_work
 Occurs when run_worker_async() is called. More...
 
event< background_worker, progress_changed_event_handlerxtd::forms::background_worker::progress_changed
 Occurs when report_progress(int32_t) is called. More...
 
event< background_worker, run_worker_completed_event_handlerxtd::forms::background_worker::run_worker_completed
 Occurs when the background operation has completed, has been canceled, or has raised an exception. More...
 

Events

event< button_base, event_handlerxtd::forms::button_base::image_changed
 Occurs when the value of the image property changes. More...
 

Events

event< check_box, event_handlerxtd::forms::check_box::appearance_changed
 Occurs when the value of the appearance property changes. More...
 
event< check_box, event_handlerxtd::forms::check_box::checked_changed
 Occurs when the value of the checked property changes. More...
 
event< check_box, event_handlerxtd::forms::check_box::check_state_changed
 Occurs when the value of the check_state property changes. More...
 

Events

xtd::event< collapsible_panel, xtd::event_handlerxtd::forms::collapsible_panel::expanded_changed
 Occurs when the expanded property changes. More...
 

Events

event< color_picker, event_handlerxtd::forms::color_picker::color_changed
 Occurs when the value of the color property changes. More...
 

Events

event< combo_box, event_handlerxtd::forms::combo_box::drop_down_style_changed
 Occurs when the drop_down_style property has changed. More...
 

Events

event< common_dialog, help_event_handlerxtd::forms::common_dialog::help_request
 Occurs when the user clicks the Help button on a common dialog box. More...
 
event< common_dialog, dialog_closed_event_handlerxtd::forms::common_dialog::dialog_closed
 Occurs when the user close a common dialog box with dialog close button or other dialog buttons. More...
 

Events

event< control, event_handlerxtd::forms::control::auto_size_changed
 Occurs when the value of the auto_size property changes. More...
 
event< control, event_handlerxtd::forms::control::back_color_changed
 Occurs when the value of the back_color property changes. More...
 
event< control, event_handlerxtd::forms::control::background_image_changed
 Occurs when the value of the background_image property changes. More...
 
event< control, event_handlerxtd::forms::control::background_image_layout_changed
 Occurs when the value of the background_image_layout property changes. More...
 
event< control, event_handlerxtd::forms::control::click
 Occurs when the control is clicked. More...
 
event< control, event_handlerxtd::forms::control::client_size_changed
 Occurs when the value of the client_size property changes. More...
 
event< control, event_handlerxtd::forms::control::cursor_changed
 Occurs when the value of the cursor property changes. More...
 
event< control, control_event_handlerxtd::forms::control::control_added
 Occurs when a new control is added to the control::control_collection. More...
 
event< control, control_event_handlerxtd::forms::control::control_removed
 Occurs when a new control is removed to the control::control_collection. More...
 
event< control, event_handlerxtd::forms::control::dock_changed
 Occurs when the value of the dock property changes. More...
 
event< control, event_handlerxtd::forms::control::double_click
 Occurs when the control is double-clicked. More...
 
event< control, event_handlerxtd::forms::control::got_focus
 Occurs when the control receives focus. More...
 
event< control, event_handlerxtd::forms::control::handle_created
 Occurs when a handle is created for the control. More...
 
event< control, event_handlerxtd::forms::control::handle_destroyed
 Occurs when the control's handle is in the process of being destroyed. More...
 
event< control, event_handlerxtd::forms::control::enabled_changed
 Occurs when the value of the enabled property changes. More...
 
event< control, event_handlerxtd::forms::control::fore_color_changed
 Occurs when the value of the fore_color property changes. More...
 
event< control, event_handlerxtd::forms::control::font_changed
 Occurs when the value of the font property changes. More...
 
event< control, key_event_handlerxtd::forms::control::key_down
 Occurs when a key is pressed while the control has focus. More...
 
event< control, key_press_event_handlerxtd::forms::control::key_press
 Occurs when a character. space or backspace key is pressed while the control has focus. More...
 
event< control, key_event_handlerxtd::forms::control::key_up
 Occurs when a key is released while the control has focus. More...
 
event< control, event_handlerxtd::forms::control::layout
 Occurs when a control should reposition its child controls. More...
 
event< control, event_handlerxtd::forms::control::location_changed
 Occurs when the value of the location property changes. More...
 
event< control, event_handlerxtd::forms::control::lost_focus
 Occurs when the control loses focus. More...
 
event< control, mouse_event_handlerxtd::forms::control::mouse_click
 Occurs when the control is clicked by the mouse. More...
 
event< control, mouse_event_handlerxtd::forms::control::mouse_double_click
 Occurs when the control is double clicked by the mouse. More...
 
event< control, mouse_event_handlerxtd::forms::control::mouse_down
 Occurs when the mouse pointer is over the control and a mouse button is pressed. More...
 
event< control, event_handlerxtd::forms::control::mouse_enter
 Occurs when the mouse pointer enters the control. More...
 
event< control, mouse_event_handlerxtd::forms::control::mouse_horizontal_wheel
 Occurs when the mouse horizontal wheel moves while the control has focus. More...
 
event< control, event_handlerxtd::forms::control::mouse_leave
 Occurs when the mouse pointer leaves the control. More...
 
event< control, mouse_event_handlerxtd::forms::control::mouse_move
 Occurs when the mouse pointer is moved over the control. More...
 
event< control, mouse_event_handlerxtd::forms::control::mouse_up
 Occurs when the mouse pointer is over the control and a mouse button is released. More...
 
event< control, mouse_event_handlerxtd::forms::control::mouse_wheel
 Occurs when the mouse wheel moves while the control has focus. More...
 
event< control, paint_event_handlerxtd::forms::control::paint
 Occurs when the control is redrawn. More...
 
event< control, event_handlerxtd::forms::control::parent_changed
 Occurs when the value of the parent property changes. More...
 
event< control, event_handlerxtd::forms::control::resize
 Occurs when the control is resized. More...
 
event< control, event_handlerxtd::forms::control::size_changed
 Occurs when the value of the size property changes. More...
 
event< control, event_handlerxtd::forms::control::text_changed
 Occurs when the value of the text property changes. More...
 
event< control, event_handlerxtd::forms::control::visible_changed
 Occurs when the value of the visible property changes. More...
 

Protected methods

virtual void xtd::forms::control::on_auto_size_changed (const event_args &e)
 Raises the control::auto_size_changed event. More...
 
virtual void xtd::forms::control::on_back_color_changed (const event_args &e)
 Raises the control::back_color_changed event. More...
 
virtual void xtd::forms::control::on_background_image_changed (const event_args &e)
 Raises the control::background_image_changed event. More...
 
virtual void xtd::forms::control::on_background_image_layout_changed (const event_args &e)
 Raises the control::background_image_layout_changed event. More...
 
virtual void xtd::forms::control::on_click (const event_args &e)
 Raises the control::click event. More...
 
virtual void xtd::forms::control::on_client_size_changed (const event_args &e)
 Raises the control::client_size_changed event. More...
 
virtual void xtd::forms::control::on_control_added (const control_event_args &e)
 Raises the control::control_added event. More...
 
virtual void xtd::forms::control::on_control_removed (const control_event_args &e)
 Raises the control::control_removed event. More...
 
virtual void xtd::forms::control::on_create_control ()
 Raises the control::create_control event. More...
 
virtual void xtd::forms::control::on_cursor_changed (const event_args &e)
 Raises the control::cursor_changed event. More...
 
virtual void xtd::forms::control::on_dock_changed (const event_args &e)
 Raises the control::dock_changed event. More...
 
virtual void xtd::forms::control::on_double_click (const event_args &e)
 Raises the double_click event. More...
 
virtual void xtd::forms::control::on_enabled_changed (const event_args &e)
 Raises the control::enabled_changed event. More...
 
virtual void xtd::forms::control::on_fore_color_changed (const event_args &e)
 Raises the control::fore_color_changed event. More...
 
virtual void xtd::forms::control::on_font_changed (const event_args &e)
 Raises the control::font_changed event. More...
 
virtual void xtd::forms::control::on_got_focus (const event_args &e)
 Raises the control::got_focus event. More...
 
virtual void xtd::forms::control::on_handle_created (const event_args &e)
 Raises the control::handle_created event. More...
 
virtual void xtd::forms::control::on_handle_destroyed (const event_args &e)
 Raises the control::handle_destroyed event. More...
 
virtual void xtd::forms::control::on_key_down (key_event_args &e)
 Raises the control::key_down event. More...
 
virtual void xtd::forms::control::on_key_press (key_press_event_args &e)
 Raises the control::key_press event. More...
 
virtual void xtd::forms::control::on_key_up (key_event_args &e)
 Raises the control::key_up event. More...
 
virtual void xtd::forms::control::on_layout (const event_args &e)
 Raises the control::layout event. More...
 
virtual void xtd::forms::control::on_location_changed (const event_args &e)
 Raises the control::location_changed event. More...
 
virtual void xtd::forms::control::on_lost_focus (const event_args &e)
 Raises the control::lost_focus event. More...
 
virtual void xtd::forms::control::on_mouse_click (const mouse_event_args &e)
 Raises the control::mouse_click event. More...
 
virtual void xtd::forms::control::on_mouse_double_click (const mouse_event_args &e)
 Raises the control::mouse_double_click event. More...
 
virtual void xtd::forms::control::on_mouse_down (const mouse_event_args &e)
 Raises the control::mouse_down event. More...
 
virtual void xtd::forms::control::on_mouse_enter (const event_args &e)
 Raises the control::mouse_enter event. More...
 
virtual void xtd::forms::control::on_mouse_horizontal_wheel (const mouse_event_args &e)
 Raises the control::mouse_horizontal_wheel event. More...
 
virtual void xtd::forms::control::on_mouse_leave (const event_args &e)
 Raises the control::mouse_leave event. More...
 
virtual void xtd::forms::control::on_mouse_move (const mouse_event_args &e)
 Raises the control::mouse_move event. More...
 
virtual void xtd::forms::control::on_mouse_up (const mouse_event_args &e)
 Raises the control::mouse_up event. More...
 
virtual void xtd::forms::control::on_mouse_wheel (const mouse_event_args &e)
 Raises the control::mouse_wheel event. More...
 
virtual void xtd::forms::control::on_paint (paint_event_args &e)
 Raises the control::paint event. More...
 
virtual void xtd::forms::control::on_paint_background (paint_event_args &e)
 Paints the background of the control. More...
 
virtual void xtd::forms::control::on_parent_back_color_changed (const event_args &e)
 Raises the control::parent_back_color_changed event. More...
 
virtual void xtd::forms::control::on_parent_cursor_changed (const event_args &e)
 Raises the control::parent_cursor_changed event. More...
 
virtual void xtd::forms::control::on_parent_changed (const event_args &e)
 Raises the control::parent_changed event. More...
 
virtual void xtd::forms::control::on_parent_enabled_changed (const event_args &e)
 Raises the xtd::control::enabled_changed event when the xtd::control::enabled property value of the control's container changes.. More...
 
virtual void xtd::forms::control::on_parent_fore_color_changed (const event_args &e)
 Raises the control::parent_fore_color_changed event. More...
 
virtual void xtd::forms::control::on_parent_font_changed (const event_args &e)
 Raises the control::parent_font_changed event. More...
 
virtual void xtd::forms::control::on_resize (const event_args &e)
 Raises the control::resize event. More...
 
virtual void xtd::forms::control::on_size_changed (const event_args &e)
 Raises the control::size_changed event. More...
 
virtual void xtd::forms::control::on_text_changed (const event_args &e)
 Raises the control::text_changed event. More...
 
virtual void xtd::forms::control::on_visible_changed (const event_args &e)
 Raises the control::visible_changed event. More...
 

Events

event< date_time_picker, event_handlerxtd::forms::date_time_picker::value_changed
 Occurs when the value of the value property changes. More...
 

Events

event< domain_up_down, event_handlerxtd::forms::domain_up_down::selected_item_changed
 Occurs when the selected_item property has been changed. More...
 
event< domain_up_down, event_handlerxtd::forms::domain_up_down::value_changed
 Occurs when the value property has been changed. More...
 

Events

event< exception_dialog, dialog_closed_event_handlerxtd::forms::exception_dialog::dialog_closed
 Occurs when the user close an exception dialog box with dialog close button or other dialog buttons. More...
 

Events

event< font_dialog, event_handlerxtd::forms::font_dialog::apply
 Occurs when the user clicks the Apply button in the font dialog box. More...
 

Events

event< font_picker, event_handlerxtd::forms::font_picker::font_changed
 Occurs when the value of the font property changes. More...
 

Events

event< form, event_handlerxtd::forms::form::activated
 Occurs when the form is activated in code or by the user. More...
 
event< form, event_handlerxtd::forms::form::deactivate
 Occurs when the form loses focus and is no longer the active form. More...
 
event< form, form_closed_event_handlerxtd::forms::form::form_closed
 Occurs after the form is closed. More...
 
event< form, form_closing_event_handlerxtd::forms::form::form_closing
 Occurs before the form is closed. More...
 

Events

event< light_button, event_handlerxtd::forms::light_button::checked_changed
 Occurs when the value of the checked property changes. More...
 
event< light_button, event_handlerxtd::forms::light_button::check_state_changed
 Occurs when the value of the check_state property changes. More...
 

Events

event< list_control, event_handlerxtd::forms::list_control::selected_index_changed
 Occurs when the selected_index property changes. More...
 
event< list_control, event_handlerxtd::forms::list_control::selected_value_changed
 Occurs when the selected_value property changes. More...
 

Events

event< message_dialog, help_event_handlerxtd::forms::message_dialog::help_request
 Occurs when the user clicks the Help button on a common dialog box. More...
 
event< message_dialog, dialog_closed_event_handlerxtd::forms::message_dialog::dialog_closed
 Occurs when the user close a message dialog box with dialog close button or other dialog buttons. More...
 

Events

event< numeric_up_down, event_handlerxtd::forms::numeric_up_down::value_changed
 Occurs when the value property has been changed in some way. More...
 

Events

event< radio_button, event_handlerxtd::forms::radio_button::appearance_changed
 Occurs when the appearance property value changes. More...
 
event< radio_button, event_handlerxtd::forms::radio_button::checked_changed
 Occurs when the value of the checked property changes. More...
 

Events

event< scroll_bar, event_handlerxtd::forms::scroll_bar::scroll
 Occurs when the scroll box has been moved by either a mouse or keyboard action. More...
 
event< scroll_bar, event_handlerxtd::forms::scroll_bar::value_changed
 Occurs when the xtd::forms::scroll_bar::value property is changed, either by a xtd::forms::scroll_bar::scroll event or programmatically. More...
 

Events

event< switch_button, event_handlerxtd::forms::switch_button::checked_changed
 Occurs when the value of the checked property changes. More...
 

Events

event< tab_control, event_handlerxtd::forms::tab_control::selected_index_changed
 Occurs when the selected_index property has changed. More...
 

Events

event< text_box, event_handlerxtd::forms::text_box::accepts_return_changed
 Occurs when the value of the accepts_return property has changed. More...
 

Events

event< text_box_base, event_handlerxtd::forms::text_box_base::accepts_tab_changed
 Occurs when the value of the accepts_tab property has changed. More...
 
event< text_box_base, event_handlerxtd::forms::text_box_base::border_style_changed
 Occurs when the value of the accepts_tab border_style has changed. More...
 
event< text_box_base, event_handlerxtd::forms::text_box_base::multiline_changed
 Occurs when the value of the accepts_tab border_style has changed. More...
 
event< text_box_base, event_handlerxtd::forms::text_box_base::read_only_changed
 Occurs when the value of the read_only property has changed. More...
 

Events

event< timer, event_handlerxtd::forms::timer::tick
 Occurs when the specified timer interval has elapsed and the timer is enabled. More...
 

Events

event< toggle_button, event_handlerxtd::forms::toggle_button::checked_changed
 Occurs when the value of the checked property changes. More...
 
event< toggle_button, event_handlerxtd::forms::toggle_button::check_state_changed
 Occurs when the value of the check_state property changes. More...
 

Events

event< track_bar, event_handlerxtd::forms::track_bar::scroll
 Occurs when either a mouse or keyboard action moves the scroll box. More...
 
event< track_bar, event_handlerxtd::forms::track_bar::value_changed
 Occurs when the value property of a track bar changes, either by movement of the scroll box or by manipulation in code. More...
 

Events

event< up_down_button, event_handlerxtd::forms::up_down_button::scroll
 Occurs when either a mouse or keyboard action moves the scroll box. More...
 
event< up_down_button, event_handlerxtd::forms::up_down_button::value_changed
 Occurs when the value of the value property changes. More...
 

Typedef Documentation

◆ animation_updated_event_handler

#include <xtd.forms/include/xtd/forms/animation_update_event_handler.h>

Represents the method that will handle the update of xtd::forms::animation.

Parameters
senderThe source of the event.
eA xtd::forms::animation_updated_event_args that contains the event data.
Namespace
xtd::forms
Library
xtd.forms

◆ cancel_event_handler

using xtd::forms::cancel_event_handler = typedef delegate<void(object& sender, cancel_event_args& e)>

#include <xtd.forms/include/xtd/forms/cancel_event_handler.h>

Represents the method that handles a cancelable event.

Parameters
senderThe source of the event.
eA cancel_event_args that contains the event data.
Namespace
xtd::forms
Library
xtd.forms
Remarks
When you create a cancel_event_handler delegate, you identify the method that will handle the event. To associate the event with your event handler, add an instance of the delegate to the event. The event-handler method is called whenever the event occurs, unless you remove the delegate.

◆ console_cancel_event_handler

using xtd::console_cancel_event_handler = typedef xtd::delegate<void(console_cancel_event_args&)>

#include <xtd.core/include/xtd/console_cancel_event_handler.h>

Represents the method that will handle the cancel_key_press event of a xtd::console.

Parameters
senderThe source of the event.
eA xtd::console_cancel_event_args object that contains the event data.
Namespace
xtd
Library
xtd.core

◆ control_event_handler

using xtd::forms::control_event_handler = typedef delegate<void(object& sender, const control_event_args& e)>

#include <xtd.forms/include/xtd/forms/control_event_handler.h>

Represents the method that will handle the control_added and control_removed events of the control class.

Parameters
senderThe source of the event.
eA control_event_args that contains the event data.
Namespace
xtd::forms
Library
xtd.forms
Remarks
When you create a control_event_args delegate, you identify the method that will handle the event. To associate the event with your event handler, add an instance of the delegate to the event. The event handler is called whenever the event occurs, unless you remove the delegate.

◆ data_received_event_handler

#include <xtd.core/include/xtd/diagnostics/data_received_event_handler.h>

Represents the method that will handle the xtd::diagnostics::process::output_data_received and xtd::diagnostics::process::error_data_received event of a Process.

using data_received_event_handler = xtd::delegate<void(xtd::object& sender, const xtd::diagnostics::data_received_event_args& e)>
Parameters
senderThe source of the event.
eA xtd::diagnostics::process::data_received_event_args that contains the event data.
Namespace
xtd::diagnostics
Library
xtd.core

◆ dialog_closed_event_handler

using xtd::forms::dialog_closed_event_handler = typedef delegate<void(object& sender, const dialog_closed_event_args& e)>

#include <xtd.forms/include/xtd/forms/dialog_closed_event_handler.h>

Provides handler for a dialog closed event.

Parameters
senderThe source of the event.
eAn dialog_closed_event_args that contains event data.
Namespace
xtd::forms
Library
xtd.forms

◆ do_work_event_handler

using xtd::forms::do_work_event_handler = typedef delegate<void(object& sender, do_work_event_args& e)>

#include <xtd.forms/include/xtd/forms/do_work_event_handler.h>

Represents the method that will handle the do_work event. This class cannot be inherited.

Parameters
senderThe source of the event.
eA do_work_event_args that contains the event data.
Namespace
xtd::forms
Library
xtd.forms
Remarks
When you create a do_work_event_handler delegate, you identify the method that will handle the event. To associate the event with your event handler, add an instance of the delegate to the event. The event-handler method is called whenever the event occurs, unless you remove the delegate

◆ event_handler

#include <xtd.core/include/xtd/event_handler.h>

Represents the method that will handle an event that has no event data.

Parameters
senderThe source of the event.
eAn object that contains no event data.
Namespace
xtd
Library
xtd.core
Examples:
application_and_exception.cpp, choice.cpp, combo_box.cpp, form.cpp, and user_control.cpp.

◆ form_closed_event_handler

using xtd::forms::form_closed_event_handler = typedef delegate<void(object& sender, const form_closed_event_args& e)>

#include <xtd.forms/include/xtd/forms/form_closed_event_handler.h>

Represents the method that handles a form_closed event.

Parameters
senderThe source of the event.
eA form_closed_event_args that contains the event data.
Namespace
xtd::forms
Library
xtd.forms

◆ form_closing_event_handler

using xtd::forms::form_closing_event_handler = typedef delegate<void(object& sender, form_closing_event_args& e)>

#include <xtd.forms/include/xtd/forms/form_closing_event_handler.h>

Represents the method that handles a form_closing event.

Parameters
senderThe source of the event.
eA form_closing_event_args that contains the event data.
Namespace
xtd::forms
Library
xtd.forms

◆ generic_event_handler

template<typename event_args_t = const xtd::event_args&>
using xtd::generic_event_handler = typedef xtd::delegate<void(xtd::object& sender, event_args_t e)>

#include <xtd.core/include/xtd/event_handler.h>

Represents the method that will handle an event when the event provides data.

Template Parameters
event_args_tThe type of the event data generated by the event.
Parameters
senderThe source of the event.
eAn object that contains the event data.
Namespace
xtd
Library
xtd.core

◆ help_event_handler

using xtd::forms::help_event_handler = typedef delegate<void(object& sender, help_event_args& e)>

#include <xtd.forms/include/xtd/forms/help_event_handler.h>

Represents the method that will handle the help_requested event of a control.

Parameters
senderThe source of the event.
eA help_event_args that contains the event data.
Namespace
xtd::forms
Library
xtd.forms
Remarks
When you create a help_event_handler delegate, you identify the method that will handle the event. To associate the event with your event handler, add an instance of the delegate to the event. The event handler is called whenever the event occurs, unless you remove the delegate.

◆ item_check_event_handler

using xtd::forms::item_check_event_handler = typedef delegate<void(object& sender, item_check_event_args& e)>

#include <xtd.forms/include/xtd/forms/item_check_event_handler.h>

Represents the method that will handle the ItemCheck event of a CheckedListBox or ListView control.

Parameters
senderThe source of the event.
eAn ItemCheckEventArgs that contains the event data.
Namespace
xtd::forms
Library
xtd.forms
Remarks
When you create an item_check_event_handler delegate, you identify the method that will handle the event. To associate the event with your event handler, add an instance of the delegate to the event. The event handler is called whenever the event occurs, unless you remove the delegate.

◆ key_event_handler

using xtd::forms::key_event_handler = typedef delegate<void(object& sender, key_event_args& e)>

#include <xtd.forms/include/xtd/forms/key_event_handler.h>

Represents the method that will handle the key_up or key_down event of a control.

Parameters
senderThe source of the event.
eA key_event_args that contains the event data.
Namespace
xtd::forms
Library
xtd.forms

◆ key_press_event_handler

using xtd::forms::key_press_event_handler = typedef delegate<void(object& sender, key_press_event_args& e)>

#include <xtd.forms/include/xtd/forms/key_press_event_handler.h>

Represents the method that will handle the key_press event of a control.

Parameters
senderThe source of the event.
eA key_press_event_args that contains the event data.
Namespace
xtd::forms
Library
xtd.forms

◆ message_loop_callback

using xtd::forms::message_loop_callback = typedef delegate<bool()>

#include <xtd.forms/include/xtd/forms/message_loop_callback.h>

Represents a method that will check whether the hosting environment is still sending messages.

Namespace
xtd::forms
Library
xtd.forms
Returns
true if the hosting environment is still sending messages; otherwise, false.
Remarks
This delegate is used with the application::register_message_loop method.

◆ mouse_event_handler

using xtd::forms::mouse_event_handler = typedef delegate<void(object& sender, const mouse_event_args& e)>

#include <xtd.forms/include/xtd/forms/mouse_event_handler.h>

Represents the method that will handle the MouseDown, MouseUp, or MouseMove event of a form, control, or other component.

Parameters
senderThe source of the event.
eA xtd::forms::mouse_event_args that contains the event data.
Namespace
xtd::forms
Library
xtd.forms

◆ paint_event_handler

using xtd::forms::paint_event_handler = typedef delegate<void(object& sender, paint_event_args& e)>

#include <xtd.forms/include/xtd/forms/paint_event_handler.h>

Represents the method that will handle the paint event of a control.

Parameters
senderThe source of the event.
eA paint_event_args that contains the event data.
Namespace
xtd::forms
Library
xtd.forms

◆ progress_changed_event_handler

using xtd::forms::progress_changed_event_handler = typedef delegate<void(object& sender, const progress_changed_event_args& e)>

#include <xtd.forms/include/xtd/forms/progress_changed_event_handler.h>

Represents the method that will handle the do_work event. This class cannot be inherited.

Parameters
senderThe source of the event.
eA do_work_event_args that contains the event data.
Namespace
xtd::forms
Library
xtd.forms
Remarks
When you create a progress_changed_event_handler delegate, you identify the method that will handle the event. To associate the event with your event handler, add an instance of the delegate to the event. The event-handler method is called whenever the event occurs, unless you remove the delegate

◆ run_worker_completed_event_handler

#include <xtd.forms/include/xtd/forms/run_worker_completed_event_handler.h>

Represents the method that will handle the do_work event. This class cannot be inherited.

Parameters
senderThe source of the event.
eA do_work_event_args that contains the event data.
Namespace
xtd::forms
Library
xtd.forms
Remarks
When you create a run_worker_completed_event_handler delegate, you identify the method that will handle the event. To associate the event with your event handler, add an instance of the delegate to the event. The event-handler method is called whenever the event occurs, unless you remove the delegate

Function Documentation

◆ on_auto_size_changed()

virtual void xtd::forms::control::on_auto_size_changed ( const event_args e)
protectedvirtual

#include <xtd.forms/include/xtd/forms/control.h>

Raises the control::auto_size_changed event.

Parameters
eAn xtd::event_args that contains the event data.

◆ on_back_color_changed()

virtual void xtd::forms::control::on_back_color_changed ( const event_args e)
protectedvirtual

◆ on_background_image_changed()

virtual void xtd::forms::control::on_background_image_changed ( const event_args e)
protectedvirtual

#include <xtd.forms/include/xtd/forms/control.h>

Raises the control::background_image_changed event.

Parameters
eAn xtd::event_args that contains the event data.

◆ on_background_image_layout_changed()

virtual void xtd::forms::control::on_background_image_layout_changed ( const event_args e)
protectedvirtual

#include <xtd.forms/include/xtd/forms/control.h>

Raises the control::background_image_layout_changed event.

Parameters
eAn xtd::event_args that contains the event data.

◆ on_click()

virtual void xtd::forms::control::on_click ( const event_args e)
protectedvirtual

#include <xtd.forms/include/xtd/forms/control.h>

Raises the control::click event.

Parameters
eAn xtd::event_args that contains the event data.

Reimplemented in xtd::forms::button.

◆ on_client_size_changed()

virtual void xtd::forms::control::on_client_size_changed ( const event_args e)
protectedvirtual

#include <xtd.forms/include/xtd/forms/control.h>

Raises the control::client_size_changed event.

Parameters
eAn xtd::event_args that contains the event data.

◆ on_control_added()

virtual void xtd::forms::control::on_control_added ( const control_event_args e)
protectedvirtual

◆ on_control_removed()

virtual void xtd::forms::control::on_control_removed ( const control_event_args e)
protectedvirtual

◆ on_create_control()

virtual void xtd::forms::control::on_create_control ( )
protectedvirtual

#include <xtd.forms/include/xtd/forms/control.h>

Raises the control::create_control event.

Parameters
eAn xtd::event_args that contains the event data.

◆ on_cursor_changed()

virtual void xtd::forms::control::on_cursor_changed ( const event_args e)
protectedvirtual

#include <xtd.forms/include/xtd/forms/control.h>

Raises the control::cursor_changed event.

Parameters
eAn xtd::event_args that contains the event data.

Reimplemented in xtd::forms::link_label.

◆ on_dock_changed()

virtual void xtd::forms::control::on_dock_changed ( const event_args e)
protectedvirtual

#include <xtd.forms/include/xtd/forms/control.h>

Raises the control::dock_changed event.

Parameters
eAn xtd::event_args that contains the event data.

◆ on_double_click()

virtual void xtd::forms::control::on_double_click ( const event_args e)
protectedvirtual

#include <xtd.forms/include/xtd/forms/control.h>

Raises the double_click event.

Parameters
eAn xtd::event_args that contains the event data.

◆ on_enabled_changed()

virtual void xtd::forms::control::on_enabled_changed ( const event_args e)
protectedvirtual

◆ on_font_changed()

virtual void xtd::forms::control::on_font_changed ( const event_args e)
protectedvirtual

#include <xtd.forms/include/xtd/forms/control.h>

Raises the control::font_changed event.

Parameters
eAn xtd::event_args that contains the event data.

Reimplemented in xtd::forms::button_base, xtd::forms::label, xtd::forms::font_picker, and xtd::forms::group_box.

◆ on_fore_color_changed()

virtual void xtd::forms::control::on_fore_color_changed ( const event_args e)
protectedvirtual

◆ on_got_focus()

virtual void xtd::forms::control::on_got_focus ( const event_args e)
protectedvirtual

#include <xtd.forms/include/xtd/forms/control.h>

Raises the control::got_focus event.

Parameters
eAn xtd::event_args that contains the event data.

Reimplemented in xtd::forms::radio_button.

◆ on_handle_created()

virtual void xtd::forms::control::on_handle_created ( const event_args e)
protectedvirtual

◆ on_handle_destroyed()

virtual void xtd::forms::control::on_handle_destroyed ( const event_args e)
protectedvirtual

#include <xtd.forms/include/xtd/forms/control.h>

Raises the control::handle_destroyed event.

Parameters
eAn xtd::event_args that contains the event data.

Reimplemented in xtd::forms::form, and xtd::forms::tool_bar.

◆ on_key_down()

virtual void xtd::forms::control::on_key_down ( key_event_args e)
protectedvirtual

#include <xtd.forms/include/xtd/forms/control.h>

Raises the control::key_down event.

Parameters
eAn xtd::event_args that contains the event data.

◆ on_key_press()

virtual void xtd::forms::control::on_key_press ( key_press_event_args e)
protectedvirtual

#include <xtd.forms/include/xtd/forms/control.h>

Raises the control::key_press event.

Parameters
eAn xtd::event_args that contains the event data.

◆ on_key_up()

virtual void xtd::forms::control::on_key_up ( key_event_args e)
protectedvirtual

#include <xtd.forms/include/xtd/forms/control.h>

Raises the control::key_up event.

Parameters
eAn xtd::event_args that contains the event data.

◆ on_layout()

virtual void xtd::forms::control::on_layout ( const event_args e)
protectedvirtual

◆ on_location_changed()

virtual void xtd::forms::control::on_location_changed ( const event_args e)
protectedvirtual

#include <xtd.forms/include/xtd/forms/control.h>

Raises the control::location_changed event.

Parameters
eAn xtd::event_args that contains the event data.

Reimplemented in xtd::forms::form.

◆ on_lost_focus()

virtual void xtd::forms::control::on_lost_focus ( const event_args e)
protectedvirtual

#include <xtd.forms/include/xtd/forms/control.h>

Raises the control::lost_focus event.

Parameters
eAn xtd::event_args that contains the event data.

Reimplemented in xtd::forms::radio_button.

◆ on_mouse_click()

virtual void xtd::forms::control::on_mouse_click ( const mouse_event_args e)
protectedvirtual

#include <xtd.forms/include/xtd/forms/control.h>

Raises the control::mouse_click event.

Parameters
eAn xtd::event_args that contains the event data.

Reimplemented in xtd::forms::link_label.

◆ on_mouse_double_click()

virtual void xtd::forms::control::on_mouse_double_click ( const mouse_event_args e)
protectedvirtual

#include <xtd.forms/include/xtd/forms/control.h>

Raises the control::mouse_double_click event.

Parameters
eAn xtd::event_args that contains the event data.

◆ on_mouse_down()

virtual void xtd::forms::control::on_mouse_down ( const mouse_event_args e)
protectedvirtual

◆ on_mouse_enter()

virtual void xtd::forms::control::on_mouse_enter ( const event_args e)
protectedvirtual

◆ on_mouse_horizontal_wheel()

virtual void xtd::forms::control::on_mouse_horizontal_wheel ( const mouse_event_args e)
protectedvirtual

#include <xtd.forms/include/xtd/forms/control.h>

Raises the control::mouse_horizontal_wheel event.

Parameters
eAn xtd::event_args that contains the event data.

◆ on_mouse_leave()

virtual void xtd::forms::control::on_mouse_leave ( const event_args e)
protectedvirtual

◆ on_mouse_move()

virtual void xtd::forms::control::on_mouse_move ( const mouse_event_args e)
protectedvirtual

#include <xtd.forms/include/xtd/forms/control.h>

Raises the control::mouse_move event.

Parameters
eAn xtd::event_args that contains the event data.

Reimplemented in xtd::forms::radio_button, xtd::forms::link_label, and xtd::forms::splitter.

◆ on_mouse_up()

virtual void xtd::forms::control::on_mouse_up ( const mouse_event_args e)
protectedvirtual

◆ on_mouse_wheel()

virtual void xtd::forms::control::on_mouse_wheel ( const mouse_event_args e)
protectedvirtual

#include <xtd.forms/include/xtd/forms/control.h>

Raises the control::mouse_wheel event.

Parameters
eAn xtd::event_args that contains the event data.

◆ on_paint()

virtual void xtd::forms::control::on_paint ( paint_event_args e)
protectedvirtual

◆ on_paint_background()

virtual void xtd::forms::control::on_paint_background ( paint_event_args e)
protectedvirtual

#include <xtd.forms/include/xtd/forms/control.h>

Paints the background of the control.

Parameters
eAn xtd::event_args that contains the event data.
Remarks
The xtd::forms::control::on_paint_background method enables derived classes to handle Windows background erase requests.

◆ on_parent_back_color_changed()

virtual void xtd::forms::control::on_parent_back_color_changed ( const event_args e)
protectedvirtual

#include <xtd.forms/include/xtd/forms/control.h>

Raises the control::parent_back_color_changed event.

Parameters
eAn xtd::event_args that contains the event data.

Reimplemented in xtd::forms::button_base.

◆ on_parent_changed()

virtual void xtd::forms::control::on_parent_changed ( const event_args e)
protectedvirtual

#include <xtd.forms/include/xtd/forms/control.h>

Raises the control::parent_changed event.

Parameters
eAn xtd::event_args that contains the event data.

◆ on_parent_cursor_changed()

virtual void xtd::forms::control::on_parent_cursor_changed ( const event_args e)
protectedvirtual

#include <xtd.forms/include/xtd/forms/control.h>

Raises the control::parent_cursor_changed event.

Parameters
eAn xtd::event_args that contains the event data.

◆ on_parent_enabled_changed()

virtual void xtd::forms::control::on_parent_enabled_changed ( const event_args e)
protectedvirtual

#include <xtd.forms/include/xtd/forms/control.h>

Raises the xtd::control::enabled_changed event when the xtd::control::enabled property value of the control's container changes..

Parameters
eAn xtd::event_args that contains the event data.

Reimplemented in xtd::forms::seven_segment_display.

◆ on_parent_font_changed()

virtual void xtd::forms::control::on_parent_font_changed ( const event_args e)
protectedvirtual

#include <xtd.forms/include/xtd/forms/control.h>

Raises the control::parent_font_changed event.

Parameters
eAn xtd::event_args that contains the event data.

◆ on_parent_fore_color_changed()

virtual void xtd::forms::control::on_parent_fore_color_changed ( const event_args e)
protectedvirtual

#include <xtd.forms/include/xtd/forms/control.h>

Raises the control::parent_fore_color_changed event.

Parameters
eAn xtd::event_args that contains the event data.

Reimplemented in xtd::forms::button_base.

◆ on_resize()

virtual void xtd::forms::control::on_resize ( const event_args e)
protectedvirtual

◆ on_size_changed()

virtual void xtd::forms::control::on_size_changed ( const event_args e)
protectedvirtual

#include <xtd.forms/include/xtd/forms/control.h>

Raises the control::size_changed event.

Parameters
eAn xtd::event_args that contains the event data.

Reimplemented in xtd::forms::lcd_label.

◆ on_text_changed()

virtual void xtd::forms::control::on_text_changed ( const event_args e)
protectedvirtual

◆ on_visible_changed()

virtual void xtd::forms::control::on_visible_changed ( const event_args e)
protectedvirtual

#include <xtd.forms/include/xtd/forms/control.h>

Raises the control::visible_changed event.

Parameters
eAn xtd::event_args that contains the event data.

Variable Documentation

◆ accepts_return_changed

event<text_box, event_handler> xtd::forms::text_box::accepts_return_changed

Occurs when the value of the accepts_return property has changed.

Remarks
For more information about handling events, see Handling and Raising Events.

◆ accepts_tab_changed

event<text_box_base, event_handler> xtd::forms::text_box_base::accepts_tab_changed

Occurs when the value of the accepts_tab property has changed.

Remarks
For more information about handling events, see Handling and Raising Events.

◆ activated

event<form, event_handler> xtd::forms::form::activated

Occurs when the form is activated in code or by the user.

Remarks
For more information about handling events, see Handling and Raising Events.

◆ appearance_changed [1/2]

event<radio_button, event_handler> xtd::forms::radio_button::appearance_changed

Occurs when the appearance property value changes.

Remarks
For more information about handling events, see Handling and Raising Events.

◆ appearance_changed [2/2]

event<check_box, event_handler> xtd::forms::check_box::appearance_changed

Occurs when the value of the appearance property changes.

Remarks
For more information about handling events, see Handling and Raising Events.

◆ application_exit

event<application, delegate<void(const event_args&)> > xtd::forms::application::application_exit
static

Occurs when the application is about to shut down.

Remarks
You must attach the event handlers to the application_exit event to perform unhandled, required tasks before the application stops running. You can close files opened by this application, or dispose of objects that garbage collection did not reclaim.
For more information about handling events, see Handling and Raising Events.

◆ apply

event<font_dialog, event_handler> xtd::forms::font_dialog::apply

Occurs when the user clicks the Apply button in the font dialog box.

Remarks
Every time the Apply button is clicked, another apply event is raised.
For more information about handling events, see Handling and Raising Events.

◆ auto_size_changed

event<control, event_handler> xtd::forms::control::auto_size_changed

Occurs when the value of the auto_size property changes.

Remarks
This event is raised if the auto_size property is changed by either a programmatic modification or user interaction.
For more information about handling events, see Handling and Raising Events.

◆ back_color_changed

event<control, event_handler> xtd::forms::control::back_color_changed

Occurs when the value of the back_color property changes.

Remarks
This event is raised if the back_color property is changed by either a programmatic modification or user interaction.
For more information about handling events, see Handling and Raising Events.

◆ background_image_changed

event<control, event_handler> xtd::forms::control::background_image_changed

Occurs when the value of the background_image property changes.

Remarks
This event is raised if the background_image property is changed by either a programmatic modification or user interaction
For more information about handling events, see Handling and Raising Events.

◆ background_image_layout_changed

event<control, event_handler> xtd::forms::control::background_image_layout_changed

Occurs when the value of the background_image_layout property changes.

Remarks
This event is raised if the background_image_layout property is changed by either a programmatic modification or user interaction
For more information about handling events, see Handling and Raising Events.

◆ border_style_changed

event<text_box_base, event_handler> xtd::forms::text_box_base::border_style_changed

Occurs when the value of the accepts_tab border_style has changed.

Remarks
For more information about handling events, see Handling and Raising Events.

◆ check_state_changed [1/3]

event<toggle_button, event_handler> xtd::forms::toggle_button::check_state_changed

Occurs when the value of the check_state property changes.

Remarks
For more information about handling events, see Handling and Raising Events.

◆ check_state_changed [2/3]

event<light_button, event_handler> xtd::forms::light_button::check_state_changed

Occurs when the value of the check_state property changes.

Remarks
For more information about handling events, see Handling and Raising Events.

◆ check_state_changed [3/3]

event<check_box, event_handler> xtd::forms::check_box::check_state_changed

Occurs when the value of the check_state property changes.

Remarks
For more information about handling events, see Handling and Raising Events.

◆ checked_changed [1/5]

event<radio_button, event_handler> xtd::forms::radio_button::checked_changed

Occurs when the value of the checked property changes.

Remarks
For more information about handling events, see Handling and Raising Events.

◆ checked_changed [2/5]

event<toggle_button, event_handler> xtd::forms::toggle_button::checked_changed

Occurs when the value of the checked property changes.

Remarks
For more information about handling events, see Handling and Raising Events.

◆ checked_changed [3/5]

event<switch_button, event_handler> xtd::forms::switch_button::checked_changed

Occurs when the value of the checked property changes.

Remarks
For more information about handling events, see Handling and Raising Events.

◆ checked_changed [4/5]

event<light_button, event_handler> xtd::forms::light_button::checked_changed

Occurs when the value of the checked property changes.

Remarks
For more information about handling events, see Handling and Raising Events.

◆ checked_changed [5/5]

event<check_box, event_handler> xtd::forms::check_box::checked_changed

Occurs when the value of the checked property changes.

Remarks
For more information about handling events, see Handling and Raising Events.

◆ click

event<control, event_handler> xtd::forms::control::click

Occurs when the control is clicked.

Remarks
The click event passes an xtd::event_args to its event handler, so it only indicates that a click has occurred. If you need more specific mouse information (button, number of clicks, wheel rotation, or location), use the mouse_click event. However, the mouse_click event will not be raised if the click is caused by action other than that of the mouse, such as pressing the ENTER key.
A double-click is determined by the mouse settings of the user's operating system. The user can set the time between clicks of a mouse button that should be considered a double-click rather than two clicks. The click event is raised every time a control is double-clicked. For example, if you have event handlers for the click and double_click events of a xtd::forms::form, the click and double_click events are raised when the form is double-clicked and both methods are called. If a control is double-clicked and that control does not support the double_click event, the click event might be raised twice.
You must set the standard_click value of xtd::forms::control_styles to true for this event to be raised.
Note
The following events are not raised for the xtd::forms::tab_control class unless there is at least one xtd::forms::tab_page in the xtd::forms::tab_control. xtd::forms::tab_control::tab_pages collection: click, double_click, mouse_down, mouse_up, mouse_hover, mouse_enter, mouse_leave and mouse_move. If there is at least one xtd::forms::tab_page in the collection, and the user interacts with the tab control's header (where the xtd::forms::tab_page names appear), the xtd::forms::tab_control raises the appropriate event. However, if the user interaction is within the client area of the tab page, the xtd::forms::tab_page raises the appropriate event.
Notes to Inheritors
Inheriting from a standard Windows Forms control and changing the standard_click or standard_double_click values of xtd::forms::control_styles to true can cause unexpected behavior or have no effect at all if the control does not support the click or double_click events.
Remarks
The following table lists Windows Forms controls and which event (click or double_click) is raised in response to the mouse action specified.
Control Left Mouse Click Left Mouse Double Click Right Mouse Click Right Mouse Click Middle Mouse Click Middle Mouse Double Click XButton1 Mouse Click XButton1 Mouse Double-Click XButton2 Mouse Click XButton2 Mouse Double-Click
xtd::forms::month_calendar, xtd::forms::date_time_picker, xtd::forms::h_scroll_bar, xtd::forms::v_scroll_bar none none none none none none none none none none
xtd::forms::button, xtd::forms::check_box, xtd::forms::color_picker, xtd::forms::command_link_button, xtd::forms::font_picker, xtd::forms::rich_text_box, xtd::forms::radio_button, xtd::forms::switch_button, xtd::forms::toggle_button click click, click none none none none none none none none
xtd::forms::list_box, xtd::forms::checked_list_box, xtd::forms::choice, xtd::forms::combo_box click click, double_click none none none none none none none none
xtd::forms::text_box, xtd::forms::domain_up_down, xtd::forms::numeric_up_down click click, double_click none none none none none none none none
* xtd::forms::tree_view, * xtd::forms::list_view click click, double_click click click, double_click none none none none none none
xtd::forms::progress_bar, xtd::forms::track_bar click click, click click click, click click click, click click click, click click click, click
xtd::forms::form, xtd::forms::collapsible_panel, xtd::forms::data_grid, xtd::forms::dot_matrix_display, xtd::forms::label, xtd::forms::lcd_label, xtd::forms::link_label, xtd::forms::nine_segment_display, xtd::forms::seven_segment_display, xtd::forms::sixteen_segment_display, xtd::forms::panel, xtd::forms::group_box, xtd::forms::picture_box, xtd::forms::splitter, xtd::forms::status_bar, xtd::forms::tool_bar, xtd::forms::tab_page, ** xtd::forms::tab_control click click, double_click click click, double_click click click, double_click click click, double_click click click, double_click

* The mouse pointer must be over a child object (xtd::forms::tree_node or xtd::forms::list_view_item).
** The xtd::forms::tab_control must have at least one xtd::forms::tab_page in its xtd::forms::tab_pages collection.
Examples
The following code example demonstrate the use of control mouse events.
#define TRACE
#include <xtd/xtd>
using namespace xtd;
using namespace xtd::forms;
class form1 : public form {
public:
form1() {
text("Mouse events example");
click += [&] {
};
double_click += [&] {
};
mouse_click += [&](object & sender, const mouse_event_args & e) {
xtd::diagnostics::trace::write_line("mouse_click={{button={}, clicks={}, delta={}, location=[{}], modifier_keys=[{}]}}", e.button(), e.clicks(), e.delta(), e.location(), modifier_keys());
};
mouse_double_click += [&](object & sender, const mouse_event_args & e) {
xtd::diagnostics::trace::write_line("mouse_double_click={{button={}, clicks={}, delta={}, location=[{}], modifier_keys=[{}]}}", e.button(), e.clicks(), e.delta(), e.location(), modifier_keys());
};
mouse_down += [&](object & sender, const mouse_event_args & e) {
xtd::diagnostics::trace::write_line("mouse_down={{button={}, clicks={}, delta={}, location=[{}], modifier_keys=[{}]}}", e.button(), e.clicks(), e.delta(), e.location(), modifier_keys());
};
mouse_enter += [&] {
};
mouse_horizontal_wheel += [&](object & sender, const mouse_event_args & e) {
xtd::diagnostics::trace::write_line("mouse_horizontal_wheel={{button={}, clicks={}, delta={}, location=[{}], modifier_keys=[{}]}}", e.button(), e.clicks(), e.delta(), e.location(), modifier_keys());
};
mouse_leave += [&] {
};
mouse_move += [&](object & sender, const mouse_event_args & e) {
xtd::diagnostics::trace::write_line("mouse_move={{button={}, clicks={}, delta={}, location=[{}], modifier_keys=[{}]}}", e.button(), e.clicks(), e.delta(), e.location(), modifier_keys());
};
mouse_up += [&](object & sender, const mouse_event_args & e) {
xtd::diagnostics::trace::write_line("mouse_up={{button={}, clicks={}, delta={}, location=[{}], modifier_keys=[{}]}}", e.button(), e.clicks(), e.delta(), e.location(), modifier_keys());
};
mouse_wheel += [&](object & sender, const mouse_event_args & e) {
xtd::diagnostics::trace::write_line("mouse_wheel={{button={}, clicks={}, delta={}, location=[{}], modifier_keys=[{}]}}", e.button(), e.clicks(), e.delta(), e.location(), modifier_keys());
};
}
};
int main() {
application::run(form1());
}
Remarks
For more information about handling events, see Handling and Raising Events.
Examples:
application_context.cpp.

◆ client_size_changed

event<control, event_handler> xtd::forms::control::client_size_changed

Occurs when the value of the client_size property changes.

Remarks
This event is raised if the client_size property is changed by either a programmatic modification or user interaction.
For more information about handling events, see Handling and Raising Events.

◆ color_changed

event<color_picker, event_handler> xtd::forms::color_picker::color_changed

Occurs when the value of the color property changes.

Remarks
For more information about handling events, see Handling and Raising Events.
Examples:
color_picker.cpp.

◆ control_added

event<control, control_event_handler> xtd::forms::control::control_added

Occurs when a new control is added to the control::control_collection.

Remarks
For more information about handling events, see Handling and Raising Events.

◆ control_removed

event<control, control_event_handler> xtd::forms::control::control_removed

Occurs when a new control is removed to the control::control_collection.

Remarks
For more information about handling events, see Handling and Raising Events.

◆ cursor_changed

event<control, event_handler> xtd::forms::control::cursor_changed

Occurs when the value of the cursor property changes.

Remarks
This event is raised if the cursor property is changed by either a programmatic modification or user interaction.
For more information about handling events, see Handling and Raising Events.

◆ deactivate

event<form, event_handler> xtd::forms::form::deactivate

Occurs when the form loses focus and is no longer the active form.

Remarks
For more information about handling events, see Handling and Raising Events.

◆ dialog_closed [1/3]

event<exception_dialog, dialog_closed_event_handler> xtd::forms::exception_dialog::dialog_closed

Occurs when the user close an exception dialog box with dialog close button or other dialog buttons.

Remarks
For more information about handling events, see Handling and Raising Events.

◆ dialog_closed [2/3]

event<common_dialog, dialog_closed_event_handler> xtd::forms::common_dialog::dialog_closed

Occurs when the user close a common dialog box with dialog close button or other dialog buttons.

Remarks
For more information about handling events, see Handling and Raising Events.

◆ dialog_closed [3/3]

event<message_dialog, dialog_closed_event_handler> xtd::forms::message_dialog::dialog_closed

Occurs when the user close a message dialog box with dialog close button or other dialog buttons.

Remarks
For more information about handling events, see Handling and Raising Events.

◆ do_work

event<background_worker, do_work_event_handler> xtd::forms::background_worker::do_work

Occurs when run_worker_async() is called.

Remarks
For more information about handling events, see Handling and Raising Events.

◆ dock_changed

event<control, event_handler> xtd::forms::control::dock_changed

Occurs when the value of the dock property changes.

Remarks
This event is raised if the dock property is changed by either a programmatic modification or user interaction.
For more information about handling events, see Handling and Raising Events.

◆ double_click

event<control, event_handler> xtd::forms::control::double_click

Occurs when the control is double-clicked.

Remarks
A double-click is determined by the mouse settings of the user's operating system. The user can set the time between clicks of a mouse button that should be considered a double-click rather than two clicks. The click event is raised every time a control is double-clicked. For example, if you have event handlers for the click and double_click events of a xtd::forms::form, the click and double_click events are raised when the form is double-clicked and both methods are called. If a control is double-clicked and that control does not support the double_click event, the click event might be raised twice.
You must set the standard_double_click and standard_click value of xtd::forms::control_styles to true for this event to be raised.
Note
The following events are not raised for the xtd::forms::tab_control class unless there is at least one xtd::forms::tab_page in the xtd::forms::tab_control. xtd::forms::tab_control::tab_pages collection: click, double_click, mouse_down, mouse_up, mouse_hover, mouse_enter, mouse_leave and mouse_move. If there is at least one xtd::forms::tab_page in the collection, and the user interacts with the tab control's header (where the xtd::forms::tab_page names appear), the xtd::forms::tab_control raises the appropriate event. However, if the user interaction is within the client area of the tab page, the xtd::forms::tab_page raises the appropriate event.
Notes to Inheritors
Inheriting from a standard Windows Forms control and changing the standard_click or standard_double_click values of xtd::forms::control_styles to true can cause unexpected behavior or have no effect at all if the control does not support the click or double_click events.
Remarks
The following table lists Windows Forms controls and which event (click or double_click) is raised in response to the mouse action specified.
Control Left Mouse Click Left Mouse Double Click Right Mouse Click Right Mouse Click Middle Mouse Click Middle Mouse Double Click XButton1 Mouse Click XButton1 Mouse Double-Click XButton2 Mouse Click XButton2 Mouse Double-Click
xtd::forms::month_calendar, xtd::forms::date_time_picker, xtd::forms::h_scroll_bar, xtd::forms::v_scroll_bar none none none none none none none none none none
xtd::forms::button, xtd::forms::check_box, xtd::forms::color_picker, xtd::forms::command_link_button, xtd::forms::font_picker, xtd::forms::rich_text_box, xtd::forms::radio_button, xtd::forms::switch_button, xtd::forms::toggle_button click click, click none none none none none none none none
xtd::forms::list_box, xtd::forms::checked_list_box, xtd::forms::choice, xtd::forms::combo_box click click, double_click none none none none none none none none
xtd::forms::text_box, xtd::forms::domain_up_down, xtd::forms::numeric_up_down click click, double_click none none none none none none none none
* xtd::forms::tree_view, * xtd::forms::list_view click click, double_click click click, double_click none none none none none none
xtd::forms::progress_bar, xtd::forms::track_bar click click, click click click, click click click, click click click, click click click, click
xtd::forms::form, xtd::forms::collapsible_panel, xtd::forms::data_grid, xtd::forms::dot_matrix_display, xtd::forms::label, xtd::forms::lcd_label, xtd::forms::link_label, xtd::forms::nine_segment_display, xtd::forms::seven_segment_display, xtd::forms::sixteen_segment_display, xtd::forms::panel, xtd::forms::group_box, xtd::forms::picture_box, xtd::forms::splitter, xtd::forms::status_bar, xtd::forms::tool_bar, xtd::forms::tab_page, ** xtd::forms::tab_control click click, double_click click click, double_click click click, double_click click click, double_click click click, double_click

* The mouse pointer must be over a child object (xtd::forms::tree_node or xtd::forms::list_view_item).
** The xtd::forms::tab_control must have at least one xtd::forms::tab_page in its xtd::forms::tab_pages collection.
Examples
The following code example demonstrate the use of control mouse events.
#define TRACE
#include <xtd/xtd>
using namespace xtd;
using namespace xtd::forms;
class form1 : public form {
public:
form1() {
text("Mouse events example");
click += [&] {
};
double_click += [&] {
};
mouse_click += [&](object & sender, const mouse_event_args & e) {
xtd::diagnostics::trace::write_line("mouse_click={{button={}, clicks={}, delta={}, location=[{}], modifier_keys=[{}]}}", e.button(), e.clicks(), e.delta(), e.location(), modifier_keys());
};
mouse_double_click += [&](object & sender, const mouse_event_args & e) {
xtd::diagnostics::trace::write_line("mouse_double_click={{button={}, clicks={}, delta={}, location=[{}], modifier_keys=[{}]}}", e.button(), e.clicks(), e.delta(), e.location(), modifier_keys());
};
mouse_down += [&](object & sender, const mouse_event_args & e) {
xtd::diagnostics::trace::write_line("mouse_down={{button={}, clicks={}, delta={}, location=[{}], modifier_keys=[{}]}}", e.button(), e.clicks(), e.delta(), e.location(), modifier_keys());
};
mouse_enter += [&] {
};
mouse_horizontal_wheel += [&](object & sender, const mouse_event_args & e) {
xtd::diagnostics::trace::write_line("mouse_horizontal_wheel={{button={}, clicks={}, delta={}, location=[{}], modifier_keys=[{}]}}", e.button(), e.clicks(), e.delta(), e.location(), modifier_keys());
};
mouse_leave += [&] {
};
mouse_move += [&](object & sender, const mouse_event_args & e) {
xtd::diagnostics::trace::write_line("mouse_move={{button={}, clicks={}, delta={}, location=[{}], modifier_keys=[{}]}}", e.button(), e.clicks(), e.delta(), e.location(), modifier_keys());
};
mouse_up += [&](object & sender, const mouse_event_args & e) {
xtd::diagnostics::trace::write_line("mouse_up={{button={}, clicks={}, delta={}, location=[{}], modifier_keys=[{}]}}", e.button(), e.clicks(), e.delta(), e.location(), modifier_keys());
};
mouse_wheel += [&](object & sender, const mouse_event_args & e) {
xtd::diagnostics::trace::write_line("mouse_wheel={{button={}, clicks={}, delta={}, location=[{}], modifier_keys=[{}]}}", e.button(), e.clicks(), e.delta(), e.location(), modifier_keys());
};
}
};
int main() {
trace_form trace_form;
application::run(form1());
}
Remarks
For more information about handling events, see Handling and Raising Events.

◆ drop_down_style_changed

event<combo_box, event_handler> xtd::forms::combo_box::drop_down_style_changed

Occurs when the drop_down_style property has changed.

Remarks
For more information about handling events, see Handling and Raising Events.

◆ enabled_changed

event<control, event_handler> xtd::forms::control::enabled_changed

Occurs when the value of the enabled property changes.

Remarks
This event is raised if the enabled property is changed by either a programmatic modification or user interaction.
For more information about handling events, see Handling and Raising Events.

◆ enter_thread_modal

event<application, delegate<void(const event_args&)> > xtd::forms::application::enter_thread_modal
static

Occurs when the application is about to enter a modal state.

Remarks
For more information about handling events, see Handling and Raising Events.

◆ expanded_changed

xtd::event<collapsible_panel, xtd::event_handler> xtd::forms::collapsible_panel::expanded_changed

Occurs when the expanded property changes.

Remarks
For more information about handling events, see Handling and Raising Events.

◆ font_changed [1/2]

event<font_picker, event_handler> xtd::forms::font_picker::font_changed

Occurs when the value of the font property changes.

Remarks
For more information about handling events, see Handling and Raising Events.

◆ font_changed [2/2]

event<control, event_handler> xtd::forms::control::font_changed

Occurs when the value of the font property changes.

Remarks
This event is raised if the font property is changed by either a programmatic modification or user interaction.
For more information about handling events, see Handling and Raising Events.

◆ fore_color_changed

event<control, event_handler> xtd::forms::control::fore_color_changed

Occurs when the value of the fore_color property changes.

Remarks
This event is raised if the fore_color property is changed by either a programmatic modification or user interaction.
For more information about handling events, see Handling and Raising Events.

◆ form_closed

event<form, form_closed_event_handler> xtd::forms::form::form_closed

Occurs after the form is closed.

Remarks
For more information about handling events, see Handling and Raising Events.

◆ form_closing

event<form, form_closing_event_handler> xtd::forms::form::form_closing

Occurs before the form is closed.

Remarks
For more information about handling events, see Handling and Raising Events.

◆ got_focus

event<control, event_handler> xtd::forms::control::got_focus

Occurs when the control receives focus.

Remarks
When you change the focus by using the keyboard (TAB, SHIFT+TAB, and so on), by calling the select or select_next_control methods, or by setting the container_control::active_control property to the current form, focus events occur in the following order:
  1. xtd::forms::control::enter event
  2. xtd::forms::control::got_focus event
  3. xtd::forms::control::leave event
  4. xtd::forms::control::validating event
  5. xtd::forms::control::validated event
  6. xtd::forms::control::lost_focus event
When you change the focus by using the mouse or by calling the focus method, focus events occur in the following order:
  1. xtd::forms::control::enter event
  2. xtd::forms::control::got_focus event
  3. xtd::forms::control::lost_focus event
  4. xtd::forms::control::leave event
  5. xtd::forms::control::validating event
  6. xtd::forms::control::validated event
If the causes_validation property is set to false, the xtd::forms::control::validating and xtd::forms::control::validated events are suppressed.
Note The got_focus and lost_focus events are low-level focus events that are tied to the WM_KILLFOCUS and WM_SETFOCUS Windows messages. Typically, the got_focus and lost_focus events are only used when updating when writing custom controls. Instead the enter and leave events should be used for all controls except the xtd::forms::form class, which uses the activated and deactivate events.
Warning
Do not attempt to set focus from within the enter, got_focus, leave, lost_focus, validating, or validated event handlers. Doing so can cause your application or the operating system to stop responding.
Remarks
For more information about handling events, see Handling and Raising Events.

◆ handle_created

event<control, event_handler> xtd::forms::control::handle_created

Occurs when a handle is created for the control.

Remarks
A handle is created when the xtd::forms::control is displayed for the first time. For example, if a xtd::forms::control is created that has visible set to false, the handle_created event will not be raised until visible is set to true.
For more information about handling events, see Handling and Raising Events.

◆ handle_destroyed

event<control, event_handler> xtd::forms::control::handle_destroyed

Occurs when the control's handle is in the process of being destroyed.

Remarks
During the handle_destroyed event, the control is still a valid Windows control and the handle can be recreated by calling the recreate_handle method.
For more information about handling events, see Handling and Raising Events.

◆ help_request [1/2]

event<common_dialog, help_event_handler> xtd::forms::common_dialog::help_request

Occurs when the user clicks the Help button on a common dialog box.

Remarks
For more information about handling events, see Handling and Raising Events.

◆ help_request [2/2]

event<message_dialog, help_event_handler> xtd::forms::message_dialog::help_request

Occurs when the user clicks the Help button on a common dialog box.

Remarks
For more information about handling events, see Handling and Raising Events.

◆ idle

event<application, delegate<void(const event_args&)> > xtd::forms::application::idle
static

Occurs when the application finishes processing and is about to enter the idle state.

Remarks
If you have tasks that you must perform before the thread becomes idle, attach them to this event.
Examples
The following code example demonstrate the use of application idle event.
#include <xtd/xtd>
using namespace xtd;
using namespace xtd::forms;
namespace examples {
class form1 : public form {
public:
form1() {
application::idle += {*this, &form1::on_application_idle};
}
private:
void on_application_idle(const event_args& e) {
text(ustring::format("{}", ++counter));
}
int counter = 0;
};
}
int main() {
application::run(examples::form1());
}
Remarks
For more information about handling events, see Handling and Raising Events.

◆ image_changed

event<button_base, event_handler> xtd::forms::button_base::image_changed

Occurs when the value of the image property changes.

Remarks
This event is raised if the image property is changed by either a programmatic modification or user interaction.
For more information about handling events, see Handling and Raising Events.

◆ key_down

event<control, key_event_handler> xtd::forms::control::key_down

Occurs when a key is pressed while the control has focus.

Remarks
Key events occur in the following order:
  1. xtd::forms::control::key_down event
  1. xtd::forms::control::key_press event
  1. xtd::forms::control::key_up event
To handle keyboard events only at the form level and not enable other controls to receive keyboard events, set the key_press_event_args::handled property in your form's key_press event-handling method to true. Certain keys, such as the TAB, RETURN, ESC, and arrow keys are handled by controls automatically. To have these keys raise the key_down event, you must override the is_input_key method in each control on your form. The code for the override of the is_input_key would need to determine if one of the special keys is pressed and return a value of true. Instead of overriding the is_input_key method, you can handle the preview_key_down event and set the is_input_key property to true.
Examples
The following code example demonstrate the use of control keyboard events.
#define TRACE
#include <xtd/xtd>
using namespace std;
using namespace xtd;
using namespace xtd::forms;
class form1 : public form {
public:
form1() {
text("Key events example");
control1.dock(dock_style::fill);
control1.parent(*this);
control1.key_down += [&](object & sender, key_event_args & e) {
ctrace << ustring::format("key_down={{key_code={}, key_data=[{}], value=0x{:X4}, modifiers=[{}]}}", e.key_code(), e.key_data(), e.key_value(), e.modifiers()) << endl;
};
control1.key_press += [&](object & sender, key_press_event_args & e) {
ctrace << ustring::format("key_press={{key_char={}}}", e.key_char() == 0 ? "[none]" : ustring::format("'{}'", e.key_char())) << endl;
};
control1.key_up += [&](object & sender, key_event_args & e) {
ctrace << ustring::format("key_up={{key_code={}, key_data=[{}], value=0x{:X4}, modifiers=[{}]}}", e.key_code(), e.key_data(), e.key_value(), e.modifiers()) << endl;
if (e.modifiers() == keys::none) ctrace << endl;
};
}
private:
control control1;
};
int main() {
trace_form trace_form;
application::run(form1());
}
Remarks
For more information about handling events, see Handling and Raising Events.

◆ key_press

event<control, key_press_event_handler> xtd::forms::control::key_press

Occurs when a character. space or backspace key is pressed while the control has focus.

Remarks
Key events occur in the following order:
  1. xtd::forms::control::key_down event
  1. xtd::forms::control::key_press event
  1. xtd::forms::control::key_up event
The key_press event is not raised by non-character keys other than space and backspace; however, the non-character keys do raise the key_down and key_up events.
Use the xtd::forms::key_press_event_args::key_char property to sample keystrokes at run time and to consume or modify a subset of common keystrokes.
To handle keyboard events only at the form level and not enable other controls to receive keyboard events, set the key_press_event_args::handled property in your form's key_press event-handling method to true.
Examples
The following code example demonstrate the use of control keyboard events.
#define TRACE
#include <xtd/xtd>
using namespace std;
using namespace xtd;
using namespace xtd::forms;
class form1 : public form {
public:
form1() {
text("Key events example");
control1.dock(dock_style::fill);
control1.parent(*this);
control1.key_down += [&](object & sender, key_event_args & e) {
ctrace << ustring::format("key_down={{key_code={}, key_data=[{}], value=0x{:X4}, modifiers=[{}]}}", e.key_code(), e.key_data(), e.key_value(), e.modifiers()) << endl;
};
control1.key_press += [&](object & sender, key_press_event_args & e) {
ctrace << ustring::format("key_press={{key_char={}}}", e.key_char() == 0 ? "[none]" : ustring::format("'{}'", e.key_char())) << endl;
};
control1.key_up += [&](object & sender, key_event_args & e) {
ctrace << ustring::format("key_up={{key_code={}, key_data=[{}], value=0x{:X4}, modifiers=[{}]}}", e.key_code(), e.key_data(), e.key_value(), e.modifiers()) << endl;
if (e.modifiers() == keys::none) ctrace << endl;
};
}
private:
control control1;
};
int main() {
trace_form trace_form;
application::run(form1());
}
Remarks
For more information about handling events, see Handling and Raising Events.

◆ key_up

event<control, key_event_handler> xtd::forms::control::key_up

Occurs when a key is released while the control has focus.

Remarks
Key events occur in the following order:
  1. xtd::forms::control::key_down event
  1. xtd::forms::control::key_press event
  1. xtd::forms::control::key_up event
To handle keyboard events only at the form level and not enable other controls to receive keyboard events, set the key_press_event_args::handled property in your form's key_press event-handling method to true. Certain keys, such as the TAB, RETURN, ESC, and arrow keys are handled by controls automatically. To have these keys raise the key_down event, you must override the is_input_key method in each control on your form. The code for the override of the is_input_key would need to determine if one of the special keys is pressed and return a value of true. Instead of overriding the is_input_key method, you can handle the preview_key_down event and set the is_input_key property to true.
Examples
The following code example demonstrate the use of control keyboard events.
#define TRACE
#include <xtd/xtd>
using namespace std;
using namespace xtd;
using namespace xtd::forms;
class form1 : public form {
public:
form1() {
text("Key events example");
control1.dock(dock_style::fill);
control1.parent(*this);
control1.key_down += [&](object & sender, key_event_args & e) {
ctrace << ustring::format("key_down={{key_code={}, key_data=[{}], value=0x{:X4}, modifiers=[{}]}}", e.key_code(), e.key_data(), e.key_value(), e.modifiers()) << endl;
};
control1.key_press += [&](object & sender, key_press_event_args & e) {
ctrace << ustring::format("key_press={{key_char={}}}", e.key_char() == 0 ? "[none]" : ustring::format("'{}'", e.key_char())) << endl;
};
control1.key_up += [&](object & sender, key_event_args & e) {
ctrace << ustring::format("key_up={{key_code={}, key_data=[{}], value=0x{:X4}, modifiers=[{}]}}", e.key_code(), e.key_data(), e.key_value(), e.modifiers()) << endl;
if (e.modifiers() == keys::none) ctrace << endl;
};
}
private:
control control1;
};
int main() {
trace_form trace_form;
application::run(form1());
}
Remarks
For more information about handling events, see Handling and Raising Events.

◆ layout

event<control, event_handler> xtd::forms::control::layout

Occurs when a control should reposition its child controls.

Remarks
The layout event occurs when child controls are added or removed, when the bounds of the control changes, and when other changes occur that can affect the layout of the control. The layout event can be suppressed using the suspend_layout and resume_layout methods. Suspending layout enables you to perform multiple actions on a control without having to perform a layout for each change. For example, if you resize and move a control, each operation would raise a layout event.
For more information about handling events, see Handling and Raising Events.

◆ leave_thread_modal

event<application, delegate<void(const event_args&)> > xtd::forms::application::leave_thread_modal
static

Occurs when the application is about to leave a modal state.

Remarks
For more information about handling events, see Handling and Raising Events.

◆ location_changed

event<control, event_handler> xtd::forms::control::location_changed

Occurs when the value of the location property changes.

Remarks
This event is raised if the location property is changed by either a programmatic modification or user interaction.
For more information about handling events, see Handling and Raising Events.

◆ lost_focus

event<control, event_handler> xtd::forms::control::lost_focus

Occurs when the control loses focus.

Remarks
When you change the focus by using the keyboard (TAB, SHIFT+TAB, and so on), by calling the select or select_next_control methods, or by setting the container_control::active_control property to the current form, focus events occur in the following order:
  1. xtd::forms::control::enter event
  2. xtd::forms::control::got_focus event
  3. xtd::forms::control::leave event
  4. xtd::forms::control::validating event
  5. xtd::forms::control::validated event
  6. xtd::forms::control::lost_focus event
When you change the focus by using the mouse or by calling the focus method, focus events occur in the following order:
  1. xtd::forms::control::enter event
  2. xtd::forms::control::got_focus event
  3. xtd::forms::control::lost_focus event
  4. xtd::forms::control::leave event
  5. xtd::forms::control::validating event
  6. xtd::forms::control::validated event
If the causes_validation property is set to false, the xtd::forms::control::validating and xtd::forms::control::validated events are suppressed.
If the cancel property of the xtd::forms::cancel_event_args is set to true in the validating event delegate, all events that would usually occur after the validating event are suppressed.
Note The got_focus and lost_focus events are low-level focus events that are tied to the WM_KILLFOCUS and WM_SETFOCUS Windows messages. Typically, the got_focus and lost_focus events are only used when updating when writing custom controls. Instead the enter and leave events should be used for all controls except the xtd::forms::form class, which uses the activated and deactivate events.
Warning
Do not attempt to set focus from within the enter, got_focus, leave, lost_focus, validating, or validated event handlers. Doing so can cause your application or the operating system to stop responding.
Remarks
For more information about handling events, see Handling and Raising Events.

◆ mouse_click

event<control, mouse_event_handler> xtd::forms::control::mouse_click

Occurs when the control is clicked by the mouse.

Remarks
Depressing a mouse button when the cursor is over a control typically raises the following series of events from the control:
  1. xtd::forms::control::mouse_down event
  2. xtd::forms::control::click event
  3. xtd::forms::control::mouse_click event
  4. xtd::forms::control::mouse_up event
For this to occur, the various events cannot be disabled in the control's class.
Two single clicks that occur close enough in time, as determined by the mouse settings of the user's operating system, will generate a mouse_double_click event instead of the second mouse_click event.
important
click events are logically higher-level events of a control. They are often raised by other actions, such as pressing the ENTER key when the control has focus.
Examples
The following code example demonstrate the use of control mouse events.
#define TRACE
#include <xtd/xtd>
using namespace xtd;
using namespace xtd::forms;
class form1 : public form {
public:
form1() {
text("Mouse events example");
click += [&] {
};
double_click += [&] {
};
mouse_click += [&](object & sender, const mouse_event_args & e) {
xtd::diagnostics::trace::write_line("mouse_click={{button={}, clicks={}, delta={}, location=[{}], modifier_keys=[{}]}}", e.button(), e.clicks(), e.delta(), e.location(), modifier_keys());
};
mouse_double_click += [&](object & sender, const mouse_event_args & e) {
xtd::diagnostics::trace::write_line("mouse_double_click={{button={}, clicks={}, delta={}, location=[{}], modifier_keys=[{}]}}", e.button(), e.clicks(), e.delta(), e.location(), modifier_keys());
};
mouse_down += [&](object & sender, const mouse_event_args & e) {
xtd::diagnostics::trace::write_line("mouse_down={{button={}, clicks={}, delta={}, location=[{}], modifier_keys=[{}]}}", e.button(), e.clicks(), e.delta(), e.location(), modifier_keys());
};
mouse_enter += [&] {
};
mouse_horizontal_wheel += [&](object & sender, const mouse_event_args & e) {
xtd::diagnostics::trace::write_line("mouse_horizontal_wheel={{button={}, clicks={}, delta={}, location=[{}], modifier_keys=[{}]}}", e.button(), e.clicks(), e.delta(), e.location(), modifier_keys());
};
mouse_leave += [&] {
};
mouse_move += [&](object & sender, const mouse_event_args & e) {
xtd::diagnostics::trace::write_line("mouse_move={{button={}, clicks={}, delta={}, location=[{}], modifier_keys=[{}]}}", e.button(), e.clicks(), e.delta(), e.location(), modifier_keys());
};
mouse_up += [&](object & sender, const mouse_event_args & e) {
xtd::diagnostics::trace::write_line("mouse_up={{button={}, clicks={}, delta={}, location=[{}], modifier_keys=[{}]}}", e.button(), e.clicks(), e.delta(), e.location(), modifier_keys());
};
mouse_wheel += [&](object & sender, const mouse_event_args & e) {
xtd::diagnostics::trace::write_line("mouse_wheel={{button={}, clicks={}, delta={}, location=[{}], modifier_keys=[{}]}}", e.button(), e.clicks(), e.delta(), e.location(), modifier_keys());
};
}
};
int main() {
trace_form trace_form;
application::run(form1());
}
Remarks
For more information about handling events, see Handling and Raising Events.

◆ mouse_double_click

event<control, mouse_event_handler> xtd::forms::control::mouse_double_click

Occurs when the control is double clicked by the mouse.

Remarks
The mouse_double_click event occurs when the user depresses a mouse button twice in quick succession when the cursor is over the control. The time interval that separates two single clicks from a double-click is determined by the mouse settings of the user's operating system.
The following series of events is raised by the control when such a user action takes place:
  1. xtd::forms::control::mouse_down event
  2. xtd::forms::control::click event
  3. xtd::forms::control::mouse_click event
  4. xtd::forms::control::mouse_up event
  5. xtd::forms::control::mouse_down event
  6. xtd::forms::control::double_click event
  7. xtd::forms::control::mouse_click event
  8. xtd::forms::control::mouse_up event
For this to occur, the various events cannot be disabled in the control's class.
important
double_click events are logically higher-level events of a control. They may be raised by other user actions, such as shortcut key combinations.
Examples
The following code example demonstrate the use of control mouse events.
#define TRACE
#include <xtd/xtd>
using namespace xtd;
using namespace xtd::forms;
class form1 : public form {
public:
form1() {
text("Mouse events example");
click += [&] {
};
double_click += [&] {
};
mouse_click += [&](object & sender, const mouse_event_args & e) {
xtd::diagnostics::trace::write_line("mouse_click={{button={}, clicks={}, delta={}, location=[{}], modifier_keys=[{}]}}", e.button(), e.clicks(), e.delta(), e.location(), modifier_keys());
};
mouse_double_click += [&](object & sender, const mouse_event_args & e) {
xtd::diagnostics::trace::write_line("mouse_double_click={{button={}, clicks={}, delta={}, location=[{}], modifier_keys=[{}]}}", e.button(), e.clicks(), e.delta(), e.location(), modifier_keys());
};
mouse_down += [&](object & sender, const mouse_event_args & e) {
xtd::diagnostics::trace::write_line("mouse_down={{button={}, clicks={}, delta={}, location=[{}], modifier_keys=[{}]}}", e.button(), e.clicks(), e.delta(), e.location(), modifier_keys());
};
mouse_enter += [&] {
};
mouse_horizontal_wheel += [&](object & sender, const mouse_event_args & e) {
xtd::diagnostics::trace::write_line("mouse_horizontal_wheel={{button={}, clicks={}, delta={}, location=[{}], modifier_keys=[{}]}}", e.button(), e.clicks(), e.delta(), e.location(), modifier_keys());
};
mouse_leave += [&] {
};
mouse_move += [&](object & sender, const mouse_event_args & e) {
xtd::diagnostics::trace::write_line("mouse_move={{button={}, clicks={}, delta={}, location=[{}], modifier_keys=[{}]}}", e.button(), e.clicks(), e.delta(), e.location(), modifier_keys());
};
mouse_up += [&](object & sender, const mouse_event_args & e) {
xtd::diagnostics::trace::write_line("mouse_up={{button={}, clicks={}, delta={}, location=[{}], modifier_keys=[{}]}}", e.button(), e.clicks(), e.delta(), e.location(), modifier_keys());
};
mouse_wheel += [&](object & sender, const mouse_event_args & e) {
xtd::diagnostics::trace::write_line("mouse_wheel={{button={}, clicks={}, delta={}, location=[{}], modifier_keys=[{}]}}", e.button(), e.clicks(), e.delta(), e.location(), modifier_keys());
};
}
};
int main() {
trace_form trace_form;
application::run(form1());
}
Remarks
For more information about handling events, see Handling and Raising Events.

◆ mouse_down

event<control, mouse_event_handler> xtd::forms::control::mouse_down

Occurs when the mouse pointer is over the control and a mouse button is pressed.

Remarks
Mouse events occur in the following order:
  1. xtd::forms::control::mouse_enter
  2. xtd::forms::control::mouse_move
  3. xtd::forms::control::mouse_hover / xtd::forms::control::mouse_down / xtd::forms::control::mouse_wheel / xtd::forms::control::mouse_horizontal_wheel
  4. xtd::forms::control::mouse_up
  5. xtd::forms::control::mouse_leave
Note
The following events are not raised for the tab_control class unless there is at least one tab_page in the tab_control::tab_pages collection: click, double_click, mouse_down, mouse_up, mouse_hover, mouse_enter, mouse_leave and mouse_move. If there is at least one tab_page in the collection, and the user interacts with the tab control's header (where the tab_page names appear), the tab_control raises the appropriate event. However, if the user interaction is within the client area of the tab page, the tab_page raises the appropriate event.
Examples
The following code example demonstrate the use of control mouse events.
#define TRACE
#include <xtd/xtd>
using namespace xtd;
using namespace xtd::forms;
class form1 : public form {
public:
form1() {
text("Mouse events example");
click += [&] {
};
double_click += [&] {
};
mouse_click += [&](object & sender, const mouse_event_args & e) {
xtd::diagnostics::trace::write_line("mouse_click={{button={}, clicks={}, delta={}, location=[{}], modifier_keys=[{}]}}", e.button(), e.clicks(), e.delta(), e.location(), modifier_keys());
};
mouse_double_click += [&](object & sender, const mouse_event_args & e) {
xtd::diagnostics::trace::write_line("mouse_double_click={{button={}, clicks={}, delta={}, location=[{}], modifier_keys=[{}]}}", e.button(), e.clicks(), e.delta(), e.location(), modifier_keys());
};
mouse_down += [&](object & sender, const mouse_event_args & e) {
xtd::diagnostics::trace::write_line("mouse_down={{button={}, clicks={}, delta={}, location=[{}], modifier_keys=[{}]}}", e.button(), e.clicks(), e.delta(), e.location(), modifier_keys());
};
mouse_enter += [&] {
};
mouse_horizontal_wheel += [&](object & sender, const mouse_event_args & e) {
xtd::diagnostics::trace::write_line("mouse_horizontal_wheel={{button={}, clicks={}, delta={}, location=[{}], modifier_keys=[{}]}}", e.button(), e.clicks(), e.delta(), e.location(), modifier_keys());
};
mouse_leave += [&] {
};
mouse_move += [&](object & sender, const mouse_event_args & e) {
xtd::diagnostics::trace::write_line("mouse_move={{button={}, clicks={}, delta={}, location=[{}], modifier_keys=[{}]}}", e.button(), e.clicks(), e.delta(), e.location(), modifier_keys());
};
mouse_up += [&](object & sender, const mouse_event_args & e) {
xtd::diagnostics::trace::write_line("mouse_up={{button={}, clicks={}, delta={}, location=[{}], modifier_keys=[{}]}}", e.button(), e.clicks(), e.delta(), e.location(), modifier_keys());
};
mouse_wheel += [&](object & sender, const mouse_event_args & e) {
xtd::diagnostics::trace::write_line("mouse_wheel={{button={}, clicks={}, delta={}, location=[{}], modifier_keys=[{}]}}", e.button(), e.clicks(), e.delta(), e.location(), modifier_keys());
};
}
};
int main() {
trace_form trace_form;
application::run(form1());
}
Remarks
For more information about handling events, see Handling and Raising Events.
Examples:
lcd_label2.cpp.

◆ mouse_enter

event<control, event_handler> xtd::forms::control::mouse_enter

Occurs when the mouse pointer enters the control.

Remarks
Mouse events occur in the following order:
  1. xtd::forms::control::mouse_enter
  2. xtd::forms::control::mouse_move
  3. xtd::forms::control::mouse_hover / xtd::forms::control::mouse_down / xtd::forms::control::mouse_wheel / xtd::forms::control::mouse_horizontal_wheel
  4. xtd::forms::control::mouse_up
  5. xtd::forms::control::mouse_leave
Note
The following events are not raised for the tab_control class unless there is at least one tab_page in the tab_control::tab_pages collection: click, double_click, mouse_down, mouse_up, mouse_hover, mouse_enter, mouse_leave and mouse_move. If there is at least one tab_page in the collection, and the user interacts with the tab control's header (where the tab_page names appear), the tab_control raises the appropriate event. However, if the user interaction is within the client area of the tab page, the tab_page raises the appropriate event.
Examples
The following code example demonstrate the use of control mouse events.
#define TRACE
#include <xtd/xtd>
using namespace xtd;
using namespace xtd::forms;
class form1 : public form {
public:
form1() {
text("Mouse events example");
click += [&] {
};
double_click += [&] {
};
mouse_click += [&](object & sender, const mouse_event_args & e) {
xtd::diagnostics::trace::write_line("mouse_click={{button={}, clicks={}, delta={}, location=[{}], modifier_keys=[{}]}}", e.button(), e.clicks(), e.delta(), e.location(), modifier_keys());
};
mouse_double_click += [&](object & sender, const mouse_event_args & e) {
xtd::diagnostics::trace::write_line("mouse_double_click={{button={}, clicks={}, delta={}, location=[{}], modifier_keys=[{}]}}", e.button(), e.clicks(), e.delta(), e.location(), modifier_keys());
};
mouse_down += [&](object & sender, const mouse_event_args & e) {
xtd::diagnostics::trace::write_line("mouse_down={{button={}, clicks={}, delta={}, location=[{}], modifier_keys=[{}]}}", e.button(), e.clicks(), e.delta(), e.location(), modifier_keys());
};
mouse_enter += [&] {
};
mouse_horizontal_wheel += [&](object & sender, const mouse_event_args & e) {
xtd::diagnostics::trace::write_line("mouse_horizontal_wheel={{button={}, clicks={}, delta={}, location=[{}], modifier_keys=[{}]}}", e.button(), e.clicks(), e.delta(), e.location(), modifier_keys());
};
mouse_leave += [&] {
};
mouse_move += [&](object & sender, const mouse_event_args & e) {
xtd::diagnostics::trace::write_line("mouse_move={{button={}, clicks={}, delta={}, location=[{}], modifier_keys=[{}]}}", e.button(), e.clicks(), e.delta(), e.location(), modifier_keys());
};
mouse_up += [&](object & sender, const mouse_event_args & e) {
xtd::diagnostics::trace::write_line("mouse_up={{button={}, clicks={}, delta={}, location=[{}], modifier_keys=[{}]}}", e.button(), e.clicks(), e.delta(), e.location(), modifier_keys());
};
mouse_wheel += [&](object & sender, const mouse_event_args & e) {
xtd::diagnostics::trace::write_line("mouse_wheel={{button={}, clicks={}, delta={}, location=[{}], modifier_keys=[{}]}}", e.button(), e.clicks(), e.delta(), e.location(), modifier_keys());
};
}
};
int main() {
trace_form trace_form;
application::run(form1());
}
Remarks
For more information about handling events, see Handling and Raising Events.

◆ mouse_horizontal_wheel

event<control, mouse_event_handler> xtd::forms::control::mouse_horizontal_wheel

Occurs when the mouse horizontal wheel moves while the control has focus.

Remarks
When handling the mouse_horizontal_wheel event it is important to follow the user interface (UI) standards associated with the mouse wheel. The mouse_event_args::delta property value indicates the amount the mouse wheel has been moved.
Mouse events occur in the following order:
  1. xtd::forms::control::mouse_enter
  2. xtd::forms::control::mouse_move
  3. xtd::forms::control::mouse_hover / xtd::forms::control::mouse_down / xtd::forms::control::mouse_wheel / xtd::forms::control::mouse_horizontal_wheel
  4. xtd::forms::control::mouse_up
  5. xtd::forms::control::mouse_leave
Note
The following events are not raised for the tab_control class unless there is at least one tab_page in the tab_control::tab_pages collection: click, double_click, mouse_down, mouse_up, mouse_hover, mouse_enter, mouse_leave and mouse_move. If there is at least one tab_page in the collection, and the user interacts with the tab control's header (where the tab_page names appear), the tab_control raises the appropriate event. However, if the user interaction is within the client area of the tab page, the tab_page raises the appropriate event.
Examples
The following code example demonstrate the use of control mouse events.
#define TRACE
#include <xtd/xtd>
using namespace xtd;
using namespace xtd::forms;
class form1 : public form {
public:
form1() {
text("Mouse events example");
click += [&] {
};
double_click += [&] {
};
mouse_click += [&](object & sender, const mouse_event_args & e) {
xtd::diagnostics::trace::write_line("mouse_click={{button={}, clicks={}, delta={}, location=[{}], modifier_keys=[{}]}}", e.button(), e.clicks(), e.delta(), e.location(), modifier_keys());
};
mouse_double_click += [&](object & sender, const mouse_event_args & e) {
xtd::diagnostics::trace::write_line("mouse_double_click={{button={}, clicks={}, delta={}, location=[{}], modifier_keys=[{}]}}", e.button(), e.clicks(), e.delta(), e.location(), modifier_keys());
};
mouse_down += [&](object & sender, const mouse_event_args & e) {
xtd::diagnostics::trace::write_line("mouse_down={{button={}, clicks={}, delta={}, location=[{}], modifier_keys=[{}]}}", e.button(), e.clicks(), e.delta(), e.location(), modifier_keys());
};
mouse_enter += [&] {
};
mouse_horizontal_wheel += [&](object & sender, const mouse_event_args & e) {
xtd::diagnostics::trace::write_line("mouse_horizontal_wheel={{button={}, clicks={}, delta={}, location=[{}], modifier_keys=[{}]}}", e.button(), e.clicks(), e.delta(), e.location(), modifier_keys());
};
mouse_leave += [&] {
};
mouse_move += [&](object & sender, const mouse_event_args & e) {
xtd::diagnostics::trace::write_line("mouse_move={{button={}, clicks={}, delta={}, location=[{}], modifier_keys=[{}]}}", e.button(), e.clicks(), e.delta(), e.location(), modifier_keys());
};
mouse_up += [&](object & sender, const mouse_event_args & e) {
xtd::diagnostics::trace::write_line("mouse_up={{button={}, clicks={}, delta={}, location=[{}], modifier_keys=[{}]}}", e.button(), e.clicks(), e.delta(), e.location(), modifier_keys());
};
mouse_wheel += [&](object & sender, const mouse_event_args & e) {
xtd::diagnostics::trace::write_line("mouse_wheel={{button={}, clicks={}, delta={}, location=[{}], modifier_keys=[{}]}}", e.button(), e.clicks(), e.delta(), e.location(), modifier_keys());
};
}
};
int main() {
trace_form trace_form;
application::run(form1());
}
Remarks
For more information about handling events, see Handling and Raising Events.

◆ mouse_leave

event<control, event_handler> xtd::forms::control::mouse_leave

Occurs when the mouse pointer leaves the control.

Remarks
Mouse events occur in the following order:
  1. xtd::forms::control::mouse_enter
  2. xtd::forms::control::mouse_move
  3. xtd::forms::control::mouse_hover / xtd::forms::control::mouse_down / xtd::forms::control::mouse_wheel / xtd::forms::control::mouse_horizontal_wheel
  4. xtd::forms::control::mouse_up
  5. xtd::forms::control::mouse_leave
Note
The following events are not raised for the tab_control class unless there is at least one tab_page in the tab_control::tab_pages collection: click, double_click, mouse_down, mouse_up, mouse_hover, mouse_enter, mouse_leave and mouse_move. If there is at least one tab_page in the collection, and the user interacts with the tab control's header (where the tab_page names appear), the tab_control raises the appropriate event. However, if the user interaction is within the client area of the tab page, the tab_page raises the appropriate event.
Examples
The following code example demonstrate the use of control mouse events.
#define TRACE
#include <xtd/xtd>
using namespace xtd;
using namespace xtd::forms;
class form1 : public form {
public:
form1() {
text("Mouse events example");
click += [&] {
};
double_click += [&] {
};
mouse_click += [&](object & sender, const mouse_event_args & e) {
xtd::diagnostics::trace::write_line("mouse_click={{button={}, clicks={}, delta={}, location=[{}], modifier_keys=[{}]}}", e.button(), e.clicks(), e.delta(), e.location(), modifier_keys());
};
mouse_double_click += [&](object & sender, const mouse_event_args & e) {
xtd::diagnostics::trace::write_line("mouse_double_click={{button={}, clicks={}, delta={}, location=[{}], modifier_keys=[{}]}}", e.button(), e.clicks(), e.delta(), e.location(), modifier_keys());
};
mouse_down += [&](object & sender, const mouse_event_args & e) {
xtd::diagnostics::trace::write_line("mouse_down={{button={}, clicks={}, delta={}, location=[{}], modifier_keys=[{}]}}", e.button(), e.clicks(), e.delta(), e.location(), modifier_keys());
};
mouse_enter += [&] {
};
mouse_horizontal_wheel += [&](object & sender, const mouse_event_args & e) {
xtd::diagnostics::trace::write_line("mouse_horizontal_wheel={{button={}, clicks={}, delta={}, location=[{}], modifier_keys=[{}]}}", e.button(), e.clicks(), e.delta(), e.location(), modifier_keys());
};
mouse_leave += [&] {
};
mouse_move += [&](object & sender, const mouse_event_args & e) {
xtd::diagnostics::trace::write_line("mouse_move={{button={}, clicks={}, delta={}, location=[{}], modifier_keys=[{}]}}", e.button(), e.clicks(), e.delta(), e.location(), modifier_keys());
};
mouse_up += [&](object & sender, const mouse_event_args & e) {
xtd::diagnostics::trace::write_line("mouse_up={{button={}, clicks={}, delta={}, location=[{}], modifier_keys=[{}]}}", e.button(), e.clicks(), e.delta(), e.location(), modifier_keys());
};
mouse_wheel += [&](object & sender, const mouse_event_args & e) {
xtd::diagnostics::trace::write_line("mouse_wheel={{button={}, clicks={}, delta={}, location=[{}], modifier_keys=[{}]}}", e.button(), e.clicks(), e.delta(), e.location(), modifier_keys());
};
}
};
int main() {
trace_form trace_form;
application::run(form1());
}
Remarks
For more information about handling events, see Handling and Raising Events.

◆ mouse_move

event<control, mouse_event_handler> xtd::forms::control::mouse_move

Occurs when the mouse pointer is moved over the control.

Remarks
Mouse events occur in the following order:
  1. xtd::forms::control::mouse_enter
  2. xtd::forms::control::mouse_move
  3. xtd::forms::control::mouse_hover / xtd::forms::control::mouse_down / xtd::forms::control::mouse_wheel / xtd::forms::control::mouse_horizontal_wheel
  4. xtd::forms::control::mouse_up
  5. xtd::forms::control::mouse_leave
Note
The following events are not raised for the tab_control class unless there is at least one tab_page in the tab_control::tab_pages collection: click, double_click, mouse_down, mouse_up, mouse_hover, mouse_enter, mouse_leave and mouse_move. If there is at least one tab_page in the collection, and the user interacts with the tab control's header (where the tab_page names appear), the tab_control raises the appropriate event. However, if the user interaction is within the client area of the tab page, the tab_page raises the appropriate event.
Examples
The following code example demonstrate the use of control mouse events.
#define TRACE
#include <xtd/xtd>
using namespace xtd;
using namespace xtd::forms;
class form1 : public form {
public:
form1() {
text("Mouse events example");
click += [&] {
};
double_click += [&] {
};
mouse_click += [&](object & sender, const mouse_event_args & e) {
xtd::diagnostics::trace::write_line("mouse_click={{button={}, clicks={}, delta={}, location=[{}], modifier_keys=[{}]}}", e.button(), e.clicks(), e.delta(), e.location(), modifier_keys());
};
mouse_double_click += [&](object & sender, const mouse_event_args & e) {
xtd::diagnostics::trace::write_line("mouse_double_click={{button={}, clicks={}, delta={}, location=[{}], modifier_keys=[{}]}}", e.button(), e.clicks(), e.delta(), e.location(), modifier_keys());
};
mouse_down += [&](object & sender, const mouse_event_args & e) {
xtd::diagnostics::trace::write_line("mouse_down={{button={}, clicks={}, delta={}, location=[{}], modifier_keys=[{}]}}", e.button(), e.clicks(), e.delta(), e.location(), modifier_keys());
};
mouse_enter += [&] {
};
mouse_horizontal_wheel += [&](object & sender, const mouse_event_args & e) {
xtd::diagnostics::trace::write_line("mouse_horizontal_wheel={{button={}, clicks={}, delta={}, location=[{}], modifier_keys=[{}]}}", e.button(), e.clicks(), e.delta(), e.location(), modifier_keys());
};
mouse_leave += [&] {
};
mouse_move += [&](object & sender, const mouse_event_args & e) {
xtd::diagnostics::trace::write_line("mouse_move={{button={}, clicks={}, delta={}, location=[{}], modifier_keys=[{}]}}", e.button(), e.clicks(), e.delta(), e.location(), modifier_keys());
};
mouse_up += [&](object & sender, const mouse_event_args & e) {
xtd::diagnostics::trace::write_line("mouse_up={{button={}, clicks={}, delta={}, location=[{}], modifier_keys=[{}]}}", e.button(), e.clicks(), e.delta(), e.location(), modifier_keys());
};
mouse_wheel += [&](object & sender, const mouse_event_args & e) {
xtd::diagnostics::trace::write_line("mouse_wheel={{button={}, clicks={}, delta={}, location=[{}], modifier_keys=[{}]}}", e.button(), e.clicks(), e.delta(), e.location(), modifier_keys());
};
}
};
int main() {
trace_form trace_form;
application::run(form1());
}
Remarks
For more information about handling events, see Handling and Raising Events.

◆ mouse_up

event<control, mouse_event_handler> xtd::forms::control::mouse_up

Occurs when the mouse pointer is over the control and a mouse button is released.

Remarks
Mouse events occur in the following order:
  1. xtd::forms::control::mouse_enter
  2. xtd::forms::control::mouse_move
  3. xtd::forms::control::mouse_hover / xtd::forms::control::mouse_down / xtd::forms::control::mouse_wheel / xtd::forms::control::mouse_horizontal_wheel
  4. xtd::forms::control::mouse_up
  5. xtd::forms::control::mouse_leave
Note
The following events are not raised for the tab_control class unless there is at least one tab_page in the tab_control::tab_pages collection: click, double_click, mouse_down, mouse_up, mouse_hover, mouse_enter, mouse_leave and mouse_move. If there is at least one tab_page in the collection, and the user interacts with the tab control's header (where the tab_page names appear), the tab_control raises the appropriate event. However, if the user interaction is within the client area of the tab page, the tab_page raises the appropriate event.
Examples
The following code example demonstrate the use of control mouse events.
#define TRACE
#include <xtd/xtd>
using namespace xtd;
using namespace xtd::forms;
class form1 : public form {
public:
form1() {
text("Mouse events example");
click += [&] {
};
double_click += [&] {
};
mouse_click += [&](object & sender, const mouse_event_args & e) {
xtd::diagnostics::trace::write_line("mouse_click={{button={}, clicks={}, delta={}, location=[{}], modifier_keys=[{}]}}", e.button(), e.clicks(), e.delta(), e.location(), modifier_keys());
};
mouse_double_click += [&](object & sender, const mouse_event_args & e) {
xtd::diagnostics::trace::write_line("mouse_double_click={{button={}, clicks={}, delta={}, location=[{}], modifier_keys=[{}]}}", e.button(), e.clicks(), e.delta(), e.location(), modifier_keys());
};
mouse_down += [&](object & sender, const mouse_event_args & e) {
xtd::diagnostics::trace::write_line("mouse_down={{button={}, clicks={}, delta={}, location=[{}], modifier_keys=[{}]}}", e.button(), e.clicks(), e.delta(), e.location(), modifier_keys());
};
mouse_enter += [&] {
};
mouse_horizontal_wheel += [&](object & sender, const mouse_event_args & e) {
xtd::diagnostics::trace::write_line("mouse_horizontal_wheel={{button={}, clicks={}, delta={}, location=[{}], modifier_keys=[{}]}}", e.button(), e.clicks(), e.delta(), e.location(), modifier_keys());
};
mouse_leave += [&] {
};
mouse_move += [&](object & sender, const mouse_event_args & e) {
xtd::diagnostics::trace::write_line("mouse_move={{button={}, clicks={}, delta={}, location=[{}], modifier_keys=[{}]}}", e.button(), e.clicks(), e.delta(), e.location(), modifier_keys());
};
mouse_up += [&](object & sender, const mouse_event_args & e) {
xtd::diagnostics::trace::write_line("mouse_up={{button={}, clicks={}, delta={}, location=[{}], modifier_keys=[{}]}}", e.button(), e.clicks(), e.delta(), e.location(), modifier_keys());
};
mouse_wheel += [&](object & sender, const mouse_event_args & e) {
xtd::diagnostics::trace::write_line("mouse_wheel={{button={}, clicks={}, delta={}, location=[{}], modifier_keys=[{}]}}", e.button(), e.clicks(), e.delta(), e.location(), modifier_keys());
};
}
};
int main() {
trace_form trace_form;
application::run(form1());
}
Remarks
For more information about handling events, see Handling and Raising Events.

◆ mouse_wheel

event<control, mouse_event_handler> xtd::forms::control::mouse_wheel

Occurs when the mouse wheel moves while the control has focus.

Remarks
When handling the mouse_wheel event it is important to follow the user interface (UI) standards associated with the mouse wheel. The mouse_event_args::delta property value indicates the amount the mouse wheel has been moved. The UI should scroll when the accumulated delta is plus or minus 120. The UI should scroll the number of logical lines returned by the system_information::mouse_wheel_scroll_lines property for every delta value reached. You can also scroll more smoothly in smaller that 120 unit increments, however the ratio should remain constant, that is system_information::mouse_wheel_scroll_lines lines scrolled per 120 delta units of wheel movement.
Mouse events occur in the following order:
  1. xtd::forms::control::mouse_enter
  2. xtd::forms::control::mouse_move
  3. xtd::forms::control::mouse_hover / xtd::forms::control::mouse_down / xtd::forms::control::mouse_wheel / xtd::forms::control::mouse_horizontal_wheel
  4. xtd::forms::control::mouse_up
  5. xtd::forms::control::mouse_leave
Note
The following events are not raised for the tab_control class unless there is at least one tab_page in the tab_control::tab_pages collection: click, double_click, mouse_down, mouse_up, mouse_hover, mouse_enter, mouse_leave and mouse_move. If there is at least one tab_page in the collection, and the user interacts with the tab control's header (where the tab_page names appear), the tab_control raises the appropriate event. However, if the user interaction is within the client area of the tab page, the tab_page raises the appropriate event.
Examples
The following code example demonstrate the use of control mouse events.
#define TRACE
#include <xtd/xtd>
using namespace xtd;
using namespace xtd::forms;
class form1 : public form {
public:
form1() {
text("Mouse events example");
click += [&] {
};
double_click += [&] {
};
mouse_click += [&](object & sender, const mouse_event_args & e) {
xtd::diagnostics::trace::write_line("mouse_click={{button={}, clicks={}, delta={}, location=[{}], modifier_keys=[{}]}}", e.button(), e.clicks(), e.delta(), e.location(), modifier_keys());
};
mouse_double_click += [&](object & sender, const mouse_event_args & e) {
xtd::diagnostics::trace::write_line("mouse_double_click={{button={}, clicks={}, delta={}, location=[{}], modifier_keys=[{}]}}", e.button(), e.clicks(), e.delta(), e.location(), modifier_keys());
};
mouse_down += [&](object & sender, const mouse_event_args & e) {
xtd::diagnostics::trace::write_line("mouse_down={{button={}, clicks={}, delta={}, location=[{}], modifier_keys=[{}]}}", e.button(), e.clicks(), e.delta(), e.location(), modifier_keys());
};
mouse_enter += [&] {
};
mouse_horizontal_wheel += [&](object & sender, const mouse_event_args & e) {
xtd::diagnostics::trace::write_line("mouse_horizontal_wheel={{button={}, clicks={}, delta={}, location=[{}], modifier_keys=[{}]}}", e.button(), e.clicks(), e.delta(), e.location(), modifier_keys());
};
mouse_leave += [&] {
};
mouse_move += [&](object & sender, const mouse_event_args & e) {
xtd::diagnostics::trace::write_line("mouse_move={{button={}, clicks={}, delta={}, location=[{}], modifier_keys=[{}]}}", e.button(), e.clicks(), e.delta(), e.location(), modifier_keys());
};
mouse_up += [&](object & sender, const mouse_event_args & e) {
xtd::diagnostics::trace::write_line("mouse_up={{button={}, clicks={}, delta={}, location=[{}], modifier_keys=[{}]}}", e.button(), e.clicks(), e.delta(), e.location(), modifier_keys());
};
mouse_wheel += [&](object & sender, const mouse_event_args & e) {
xtd::diagnostics::trace::write_line("mouse_wheel={{button={}, clicks={}, delta={}, location=[{}], modifier_keys=[{}]}}", e.button(), e.clicks(), e.delta(), e.location(), modifier_keys());
};
}
};
int main() {
trace_form trace_form;
application::run(form1());
}
Remarks
For more information about handling events, see Handling and Raising Events.

◆ multiline_changed

event<text_box_base, event_handler> xtd::forms::text_box_base::multiline_changed

Occurs when the value of the accepts_tab border_style has changed.

Remarks
For more information about handling events, see Handling and Raising Events.

◆ paint

event<control, paint_event_handler> xtd::forms::control::paint

Occurs when the control is redrawn.

Remarks
The paint event is raised when the control is redrawn. It passes an instance of paint_event_args to the method(s) that handles the paint event. The paint event is raised when the control is redrawn. It passes an instance of paint_event_args to the method(s) that handles the paint event.
When creating a new custom control or an inherited control with a different visual appearance, you must provide code to render the control by overriding the on_paint method.
Examples
The following code example demonstrate the use of control paint events.
#include <xtd/xtd>
using namespace xtd;
using namespace xtd::drawing;
using namespace xtd::forms;
namespace examples {
class form1 : public form {
public:
form1() {
text("Paint example");
location({100, 100});
client_size({640, 480});
paint += [](object & sender, paint_event_args & e) {
e.graphics().fill_rectangle(brushes::blue(), 0, 0, 640, 480);
e.graphics().clear(color::light_yellow);
e.graphics().draw_rectangle(pen(color::light_pink, 10), e.clip_rectangle());
e.graphics().draw_line(pen(color::light_steel_blue, 5), 20, 60, 260, 60);
e.graphics().fill_rectangle(brushes::light_blue(), 50, 300, 400, 50);
e.graphics().draw_line(pens::red(), 0, 0, 1, 1);
e.graphics().draw_string("Draw string", drawing::font("Arial", 34, font_style::regular), brushes::light_green(), 20.0f, 0.0f);
e.graphics().fill_rectangle(brushes::light_sea_green(), 400, 70, 100, 200);
e.graphics().draw_arc(pen(color::black, 10), 400, 70, 100, 200, 45, 270);
e.graphics().draw_ellipse(pen(color::red, 10), 100, 80, 200, 200);
e.graphics().fill_pie(brushes::green(), 120, 100, 160, 160, 45, 270);
e.graphics().fill_pie(brushes::light_green(), 120, 100, 160, 160, 270, 180);
e.graphics().draw_bezier(pens::black(), 100, 100, 150, 150, 200, 100, 250, 50);
};
}
};
}
int main() {
application::run(examples::form1());
}
Remarks
For more information about handling events, see Handling and Raising Events.

◆ parent_changed

event<control, event_handler> xtd::forms::control::parent_changed

Occurs when the value of the parent property changes.

Remarks
This event is raised if the parent property is changed by either a programmatic modification or user interaction.
For more information about handling events, see Handling and Raising Events.

◆ progress_changed

event<background_worker, progress_changed_event_handler> xtd::forms::background_worker::progress_changed

Occurs when report_progress(int32_t) is called.

Remarks
For more information about handling events, see Handling and Raising Events.

◆ read_only_changed

event<text_box_base, event_handler> xtd::forms::text_box_base::read_only_changed

Occurs when the value of the read_only property has changed.

Remarks
For more information about handling events, see Handling and Raising Events.

◆ resize

event<control, event_handler> xtd::forms::control::resize

Occurs when the control is resized.

Remarks
To determine the size of the resized control, you can cast the sender parameter of the registered control_event_handler method to a control and get its size property (or height and width properties individually).
To handle custom layouts, use the layout event instead of the resize event. The layout event is raised in response to a resize event, but also in response to other changes that affect the layout of the control.
Examples
The following code example demonstrate the use of control resize event.
#include <xtd/xtd>
using namespace std::literals;
using namespace xtd;
using namespace xtd::drawing;
using namespace xtd::forms;
class form1 : public form {
public:
form1() {
dot_matrix_display1.height(250);
dot_matrix_display1.location({(client_size().width() - dot_matrix_display1.width()) / 2, (client_size().height() - dot_matrix_display1.height()) / 2});
dot_matrix_display1.parent(*this);
dot_matrix_display1.fore_color(color::red);
dot_matrix_display1.anchor(anchor_styles::top | anchor_styles::bottom);
timer1.interval(300ms);
timer1.enabled(true);
timer1.tick += [&] {
dot_matrix_display1.dot_matrix_style(dot_matrix_styles[(counter / chaser.size()) % dot_matrix_styles.size()]);
dot_matrix_display1.set_dots(chaser[counter++ % chaser.size()]);
};
back_color(color::average(color::black, dot_matrix_display1.fore_color(), 0.20));
text("Dot matrix display example");
resize += [&] {
dot_matrix_display1.left((client_size().width() - dot_matrix_display1.width()) / 2);
};
}
private:
int counter = 0;
std::vector<dot_matrix_display::points_collection> chaser = {
{},
{{3, 3}},
{{3, 3}, {2, 2}, {2, 3}, {2, 4}, {3, 2}, {3, 4}, {4, 2}, {4, 3}, {4, 4}},
{{3, 3}, {2, 2}, {2, 3}, {2, 4}, {3, 2}, {3, 4}, {4, 2}, {4, 3}, {4, 4}, {1, 1}, {1, 2}, {1, 3}, {1, 4}, {1, 5}, {2, 1}, {2, 5}, {3, 1}, {3, 5}, {4, 1}, {4, 5}, {5, 1}, {5, 2}, {5, 3}, {5, 4}, {5, 5}},
{{3, 3}, {2, 2}, {2, 3}, {2, 4}, {3, 2}, {3, 4}, {4, 2}, {4, 3}, {4, 4}, {1, 1}, {1, 2}, {1, 3}, {1, 4}, {1, 5}, {2, 1}, {2, 5}, {3, 1}, {3, 5}, {4, 1}, {4, 5}, {5, 1}, {5, 2}, {5, 3}, {5, 4}, {5, 5}, {0, 0}, {0, 1}, {0, 2}, {0, 3}, {0, 4}, {0, 5}, {0, 6}, {1, 0}, {1, 6}, {2, 0}, {2, 6}, {3, 0}, {3, 6}, {4, 0}, {4, 6}, {5, 0}, {5, 6}, {6, 0}, {6, 1}, {6, 2}, {6, 3}, {6, 4}, {6, 5}, {6, 6}},
};
dot_matrix_display dot_matrix_display1;
std::vector<dot_matrix_style> dot_matrix_styles = {
};
timer timer1;
};
int main() {
application::run(form1());
}
Remarks
For more information about handling events, see Handling and Raising Events.

◆ run_worker_completed

event<background_worker, run_worker_completed_event_handler> xtd::forms::background_worker::run_worker_completed

Occurs when the background operation has completed, has been canceled, or has raised an exception.

Remarks
For more information about handling events, see Handling and Raising Events.

◆ scroll [1/3]

event<scroll_bar, event_handler> xtd::forms::scroll_bar::scroll

Occurs when the scroll box has been moved by either a mouse or keyboard action.

Remarks
For more information about handling events, see Handling and Raising Events.

◆ scroll [2/3]

event<up_down_button, event_handler> xtd::forms::up_down_button::scroll

Occurs when either a mouse or keyboard action moves the scroll box.

Remarks
For more information about handling events, see Handling and Raising Events.

◆ scroll [3/3]

event<track_bar, event_handler> xtd::forms::track_bar::scroll

Occurs when either a mouse or keyboard action moves the scroll box.

Remarks
For more information about handling events, see Handling and Raising Events.

◆ selected_index_changed [1/2]

event<tab_control, event_handler> xtd::forms::tab_control::selected_index_changed

Occurs when the selected_index property has changed.

Remarks
For more information about handling events, see Handling and Raising Events.

◆ selected_index_changed [2/2]

event<list_control, event_handler> xtd::forms::list_control::selected_index_changed

Occurs when the selected_index property changes.

Remarks
For more information about handling events, see Handling and Raising Events.

◆ selected_item_changed

event<domain_up_down, event_handler> xtd::forms::domain_up_down::selected_item_changed

Occurs when the selected_item property has been changed.

Remarks
For more information about handling events, see Handling and Raising Events.

◆ selected_value_changed

event<list_control, event_handler> xtd::forms::list_control::selected_value_changed

Occurs when the selected_value property changes.

Remarks
For more information about handling events, see Handling and Raising Events.

◆ size_changed

event<control, event_handler> xtd::forms::control::size_changed

Occurs when the value of the size property changes.

Remarks
This event is raised if the size property is changed by either a programmatic modification or user interaction.
For more information about handling events, see Handling and Raising Events.

◆ text_changed

event<control, event_handler> xtd::forms::control::text_changed

Occurs when the value of the text property changes.

Remarks
This event is raised if the text property is changed by either a programmatic modification or user interaction.
For more information about handling events, see Handling and Raising Events.

◆ thread_exit [1/2]

event<application_context, event_handler> xtd::forms::application_context::thread_exit

Occurs when the message loop of the thread should be terminated, by calling exit_thread().

Remarks
For more information about handling events, see Handling and Raising Events.

◆ thread_exit [2/2]

event<application, delegate<void(const event_args&)> > xtd::forms::application::thread_exit
static

Occurs when a thread is about to shut down. When the main thread for an application is about to be shut down, this event is raised first, followed by an application_exit event.

Remarks
You must attach the event handlers to the thread_exit event to perform any unhandled, required tasks before the thread stops running. Close files opened by this thread, or dispose of objects that the garbage collector did not reclaim.
For more information about handling events, see Handling and Raising Events.

◆ tick

event<timer, event_handler> xtd::forms::timer::tick

Occurs when the specified timer interval has elapsed and the timer is enabled.

Remarks
Calling the Assert method on the xtd::diagnostics::debug class from within the tick event may not behave as expected, as displaying the assertion dialog box may cause Windows to raise the tick event repeatedly. We recommend that you refrain from testing assertions within this event, and use the write, write_if, write_line, or write_line_if methods instead.
For more information about handling events, see Handling and Raising Events.
Examples:
lcd_label2.cpp.

◆ updated

xtd::event<animation, animation_updated_event_handler> xtd::forms::animation::updated

Occurs when the specified interval specified by xtd::animation::frames_per_seconds has elapsed and the animation is started.

Remarks
You can use this event to do things like advancing animation parameters, checking the mouse position, etc.
For more information about handling events, see Handling and Raising Events.

◆ value_changed [1/6]

event<date_time_picker, event_handler> xtd::forms::date_time_picker::value_changed

Occurs when the value of the value property changes.

Remarks
For more information about handling events, see Handling and Raising Events.

◆ value_changed [2/6]

event<scroll_bar, event_handler> xtd::forms::scroll_bar::value_changed

Occurs when the xtd::forms::scroll_bar::value property is changed, either by a xtd::forms::scroll_bar::scroll event or programmatically.

Remarks
For more information about handling events, see Handling and Raising Events.

◆ value_changed [3/6]

event<up_down_button, event_handler> xtd::forms::up_down_button::value_changed

Occurs when the value of the value property changes.

Remarks
For more information about handling events, see Handling and Raising Events.

◆ value_changed [4/6]

event<numeric_up_down, event_handler> xtd::forms::numeric_up_down::value_changed

Occurs when the value property has been changed in some way.

◆ value_changed [5/6]

event<track_bar, event_handler> xtd::forms::track_bar::value_changed

Occurs when the value property of a track bar changes, either by movement of the scroll box or by manipulation in code.

Remarks
For more information about handling events, see Handling and Raising Events.

◆ value_changed [6/6]

event<domain_up_down, event_handler> xtd::forms::domain_up_down::value_changed

Occurs when the value property has been changed.

Remarks
For more information about handling events, see Handling and Raising Events.

◆ visible_changed

event<control, event_handler> xtd::forms::control::visible_changed

Occurs when the value of the visible property changes.

Remarks
This event is raised if the visible property is changed by either a programmatic modification or user interaction.
For more information about handling events, see Handling and Raising Events.