Table of Contents

Method MeasureSingleColumnItemSize

Namespace
Alternet.UI
Assembly
Alternet.UI.Common.dll

MeasureSingleColumnItemSize(IListControlItemContainer, Graphics, int?, ListControlItem?, IFormatProvider?)

Measures the size required to display a single item in a single-column list control, including text, images, and margins.

public static SizeD MeasureSingleColumnItemSize(IListControlItemContainer container, Graphics dc, int? itemIndex, ListControlItem? item = null, IFormatProvider? formatProvider = null)

Parameters

container IListControlItemContainer

The item container that provides access to item data, text, and layout defaults.

dc Graphics

The graphics context used for measuring text and images.

itemIndex int?

The zero-based index of the item to measure, or null to use the provided item directly.

item ListControlItem

The item to measure, or null to resolve the item using the specified index.

formatProvider IFormatProvider

An object that supplies culture-specific formatting information, or null to use the current culture. If container is specified, it's format provider is used. Optional.

Returns

SizeD

A SizeD structure representing the width and height required to display the item, including any images and margins.

Remarks

If both itemIndex and item are null, the method returns SizeD.Empty. The measurement accounts for images, checkboxes, text (including multi-line text), and control-specific margins. The returned size ensures that all visual elements of the item are fully accommodated.