Skip to main content

Search OfficeIMO

Enter a topic, API type, or PowerShell command.

Documentation Search all OfficeIMO/
Struct

ExcelColumnWidth

OfficeIMO.Excel

Namespace
OfficeIMO.Excel
Assembly
OfficeIMO.Excel
Source revision
e163ccb36643 with working tree changes
Base
ValueType
Implements
IEquatable<ExcelColumnWidth>
Modifiers
sealed

A worksheet dimension expressed in Excel character units or as a physical length.

Inheritance

  • ValueType
  • ExcelColumnWidth

Remarks

Character column widths retain the stored Excel value, including cell padding. Physical column widths resolve through the workbook default font and round to the nearest 96-DPI pixel. Row heights use the physical length directly; character heights use the default font's maximum digit advance, without column padding. A zero value clears a custom dimension.

Usage

Explore 23 API references to this type

This type appears in these public API surfaces even when no hand-authored example is attached directly to the page.

Accepted by parameters 10

Methods

public static ExcelColumnWidth Characters(double value) #

Creates a dimension in Excel character units. Non-finite values are rejected.

Parameters

value double required
Equals 2 overloads
public bool Equals(ExcelColumnWidth other) #

Indicates whether the current object is equal to another object of the same type.

Parameters

other OfficeIMO.Excel.ExcelColumnWidth required
An object to compare with this object.

Returns

bool true if the current object is equal to the other parameter; otherwise, false.
public override bool Equals(object? obj) #

Indicates whether this instance and a specified object are equal.

Parameters

obj object? required
The object to compare with the current instance.

Returns

bool true if obj and this instance are the same type and represent the same value; otherwise, false.
public override int GetHashCode() #

Returns the hash code for this instance.

Returns

int A 32-bit signed integer that is the hash code for this instance.
public static ExcelColumnWidth Length(OfficeLength value) #

Creates a dimension from an explicit physical length.

Parameters

value OfficeIMO.OfficeLength required
public static bool op_Equality(ExcelColumnWidth left, ExcelColumnWidth right) #

Compares dimensions in the same authored unit. Conversion requires a worksheet.

Parameters

left OfficeIMO.Excel.ExcelColumnWidth required
right OfficeIMO.Excel.ExcelColumnWidth required

Returns

bool
public static bool op_Inequality(ExcelColumnWidth left, ExcelColumnWidth right) #

Compares dimensions in the same authored unit. Conversion requires a worksheet.

Parameters

left OfficeIMO.Excel.ExcelColumnWidth required
right OfficeIMO.Excel.ExcelColumnWidth required

Returns

bool
public double ToCharacters(ExcelSheet sheet) #

Gets the stored column width for a worksheet, resolving physical values through its default font.

Parameters

sheet OfficeIMO.Excel.ExcelSheet required

Returns

double
public OfficeLength ToLength(ExcelSheet sheet) #

Gets the physical column width for a worksheet, including native column padding and pixel rounding.

Parameters

sheet OfficeIMO.Excel.ExcelSheet required

Returns

OfficeLength
public override string ToString() #

Formats the specified dimension using invariant units.

Returns

string

Properties

public double? CharacterCount { get; } #

Gets the authored character count, or null for a physical length. No workbook is needed.

public OfficeLength? PhysicalLength { get; } #

Gets the authored physical length, or null for a character count. No workbook is needed.

public bool IsPhysical { get; } #

Gets whether the value was specified as a physical length.