xtd 0.2.0
Loading...
Searching...
No Matches

◆ image_index() [1/2]

virtual size_t xtd::forms::tab_page::image_index ( ) const
virtualnoexcept

Gets the image list index value of the image displayed on the tab_page control.

Returns
A zero-based index, which represents the image position in an image_list. The default is -1.
Remarks
When the image_index or image_list properties are set, the Image property is set to its default value, xtd::drawing::image::empty.
image_key and image_index are mutually exclusive, meaning if one is set, the other is set to an invalid value and ignored. If you set the image_key property, the image_index property is automatically set to -1. Alternatively, if you set the image_index property, the image_key is automatically set to an empty string ("").
If the image_list property value is changed to xtd::forms::image_list::empty, the image_index property returns its default value, -1. However, the assigned image_index value is retained internally and used when another image_list object is assigned to the image_list property. If the new image_list assigned to the image_list property has an imageList::_image_collection::size property value that is less than or equal to the value assigned to the image_index property minus one (to account for the collection being a zero-based index), the image_index property value is adjusted to one less than the size property value. For example, consider a tab_page control whose image_list has three images and whose image_index property is set to 2. If a new image_list that has only two images is assigned to the tab_page, the image_index value changes to 1.