xtd 0.2.0
Loading...
Searching...
No Matches
xtd::forms::item_check_event_args Class Reference
Inheritance diagram for xtd::forms::item_check_event_args:
xtd::event_args xtd::object

Definition

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

Header
#include <xtd/forms/item_check_event_args>
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 Constructors

 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.
 

Public Properties

check_state current_value () const noexcept
 Gets a value indicating the current state of the item's check box.
 
size_t index () const noexcept
 Gets the zero-based index of the item to change.
 
check_state new_value () const noexcept
 Gets a value indicating whether to set the check box for the item to be checked, unchecked, or indeterminate.
 
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.
 

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.
 
- Public Member Functions inherited from xtd::event_args
 event_args ()=default
 Initializes a new instance of the event_args class.
 
- Public Member Functions inherited from xtd::object
 object ()=default
 Create a new instance of the ultimate base class object.
 
virtual bool equals (const object &obj) const noexcept
 Determines whether the specified object is equal to the current object.
 
virtual size_t get_hash_code () const noexcept
 Serves as a hash function for a particular type.
 
virtual type_object get_type () const noexcept
 Gets the type of the current instance.
 
template<typename object_t >
xtd::uptr< object_t > memberwise_clone () const
 Creates a shallow copy of the current object.
 
virtual xtd::string to_string () const noexcept
 Returns a xtd::string that represents the current object.
 
- Static Public Member Functions inherited from xtd::object
template<typename object_a_t , typename object_b_t >
static bool equals (const object_a_t &object_a, const object_b_t &object_b) noexcept
 Determines whether the specified object instances are considered equal.
 
template<typename object_a_t , typename object_b_t >
static bool reference_equals (const object_a_t &object_a, const object_b_t &object_b) noexcept
 Determines whether the specified object instances are the same instance.
 

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
inlinenoexcept

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
inlinenoexcept

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
inlinenoexcept

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: