xtd.forms - Reference Guide  0.1.0
Modern c++17 library containing classes for creating Windows-based applications that take full advantage of the rich user interface features available in the Microsoft Windows, Apple macOS and Linux like Ubuntu operating system.
xtd::forms::item_check_event_args Class Reference

Provides data for the item_check event of the checked_list_box and list_view controls. More...

#include <item_check_event_args.hpp>

Inheritance diagram for xtd::forms::item_check_event_args:
xtd::event_args

Public Member Functions

 item_check_event_args (size_t index, check_state new_value, check_state current_value)
 Initializes a new instance of the item_check_event_args class. More...
 
check_state current_value () const
 Gets a value indicating the current state of the item's check box. More...
 
size_t index () const
 Gets the zero-based index of the item to change. More...
 
check_state new_value () const
 Gets a value indicating whether to set the check box for the item to be checked, unchecked, or indeterminate. More...
 
void new_value (check_state new_value)
 Gets a value indicating whether to set the check box for the item to be checked, unchecked, or indeterminate. More...
 

Additional Inherited Members

- Static Public Attributes inherited from xtd::event_args
static const event_args empty
 

Detailed Description

Provides data for the item_check event of the checked_list_box and list_view controls.

Remarks
The item_check event occurs when the checked state of an item in a checked list box changes. The item_check_event_args class specifies the index of the item to change, the current value of the check box for the item, and the new value to set for the check box.

Constructor & Destructor Documentation

§ item_check_event_args()

xtd::forms::item_check_event_args::item_check_event_args ( size_t  index,
check_state  new_value,
check_state  current_value 
)
inline

Initializes a new instance of the item_check_event_args class.

Parameters
indexThe zero-based index of the item to change.
new_valueOne of the check_state values that indicates whether to change the check box for the item to be checked, unchecked, or indeterminate.
current_valueOne of the check_state values that indicates whether the check box for the item is currently checked, unchecked, or indeterminate.

Member Function Documentation

§ current_value()

check_state xtd::forms::item_check_event_args::current_value ( ) const
inline

Gets a value indicating the current state of the item's check box.

Returns
One of the check_state values.
Remarks
This property enables you to determine the check state of the specified item in the checked_list_box before the check state change to apply is made.

§ index()

size_t xtd::forms::item_check_event_args::index ( ) const
inline

Gets the zero-based index of the item to change.

Returns
The zero-based index of the item to change.
Remarks
You can use this property to determine which item's check box in the checked_list_box is being changed.

§ new_value() [1/2]

check_state xtd::forms::item_check_event_args::new_value ( ) const
inline

Gets a value indicating whether to set the check box for the item to be checked, unchecked, or indeterminate.

Returns
One of the check_state values.
Remarks
This property enables you to determine the new check state for the specified item before the check state is changed by the checked_list_box control. In addition to determining the new check state, you can use this property in an event handler for the ItemCheck event to change the state to a different check state than the one specified. For example, if the user placed a check mark next to an item in the checked_list_box that you have determined should not be checked based on the state of your application, you can override the change in the check mark state by setting this property to its previous setting or to a different check state.

§ new_value() [2/2]

void xtd::forms::item_check_event_args::new_value ( check_state  new_value)
inline

Gets a value indicating whether to set the check box for the item to be checked, unchecked, or indeterminate.

Parameters
new_valueOne of the check_state values.
Remarks
This property enables you to determine the new check state for the specified item before the check state is changed by the checked_list_box control. In addition to determining the new check state, you can use this property in an event handler for the ItemCheck event to change the state to a different check state than the one specified. For example, if the user placed a check mark next to an item in the checked_list_box that you have determined should not be checked based on the state of your application, you can override the change in the check mark state by setting this property to its previous setting or to a different check state.

The documentation for this class was generated from the following file: