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.
Public Member Functions | List of all members
xtd::forms::item_check_event_args Class Reference

#include <item_check_event_args.h>

Definition

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

Namespace
xtd::forms
Library
xtd.forms
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.
Examples:
checked_list_box.cpp.

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...
 
- Public Member Functions inherited from xtd::event_args
 event_args ()=default
 Initializes a new instance of the event_args class. More...
 
- Public Member Functions inherited from xtd::object
 object ()=default
 Create a new instance of the ultimate base class object. More...
 
virtual bool equals (const object &obj) const noexcept
 Determines whether the specified object is equal to the current object. More...
 
virtual size_t get_hash_code () const noexcept
 Serves as a hash function for a particular type. More...
 
template<typename object_t >
std::unique_ptr< object_t > memberwise_clone () const
 Gets the type of the current instance. More...
 
virtual xtd::ustring to_string () const noexcept
 Returns a std::string that represents the current object. More...
 

Additional Inherited Members

- Static Public Attributes inherited from xtd::event_args
static const event_args empty
 Provides a value to use with events that do not have event data. More...
 
- Static Public Member Functions inherited from xtd::object
static bool equals (const object &object_a, const object &object_b) noexcept
 Determines whether the specified object instances are considered equal. More...
 
static bool reference_equals (const object &object_a, const object &object_b) noexcept
 Determines whether the specified object instances are the same instance. More...
 

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: