Method EnsureCreated
EnsureCreated(ref MeasureItemEventArgs?, Graphics, int)
Ensures that the specified MeasureItemEventArgs instance is initialized and associated with the given Graphics context and item index.
public static void EnsureCreated(ref MeasureItemEventArgs? e, Graphics graphics, int index = 0)
Parameters
eMeasureItemEventArgsA reference to the MeasureItemEventArgs instance to initialize or reset. If null, a new instance will be created and assigned.
graphicsGraphicsThe Graphics context to associate with the event arguments. Cannot be null.
indexintThe index of the item to be measured. The default value is 0.
EnsureCreated(ref MeasureItemEventArgs?, Graphics, int, float)
Ensures that the specified MeasureItemEventArgs instance is initialized with the provided graphics context, item index, and item height.
public static void EnsureCreated(ref MeasureItemEventArgs? e, Graphics graphics, int index, float itemHeight)
Parameters
eMeasureItemEventArgsA reference to the MeasureItemEventArgs instance to initialize. If null, a new instance is created and assigned.
graphicsGraphicsThe Graphics context used for measuring the item. Cannot be null.
indexintThe zero-based index of the item to measure.
itemHeightfloatThe height of the item to be measured.
Remarks
If e is already initialized, its state is reset with the new
parameters. Otherwise, a new MeasureItemEventArgs is created and assigned to e.