Wiki Markup |
---|
{description} {excerpt}Sets or returns the default column width as a number of character widths in the 'Normal' font. This must be a value between 0 and 255.{excerpt} {signature:C#} public double StandardWidthInChars{ get; set; } {signature}{signature:vb.net} Public Property StandardWidthInChars() As Double {signature} {example}{code:csharp|title=C#} //--- Get StandardWidthInChars ws.StandardWidthInChars = 20; //--- Set StandardWidthInChars double colWidth = ws.StandardWidthInChars; {code} {code:vb.net|title=vb.net} '--- Get StandardWidthInChars ws.StandardWidthInChars = 20 '--- Set StandardWidthInChars Dim colWidth As Double = ws.StandardWidthInChars {code} {example} {remarks} The normal font for Excel 2003 (and prior) files is 10pt Arial. The normal font for Excel 2007 and later is Calibri 11pt. Both of these fonts have a 7 pixel character width, which is about 5.25 points (for a 96-dpi screen). The default {{StandardWidthInChars}} is 8.43 characters, or about 44.25 points. For normal fonts other than 10pt Arial or 11pt Calibri, the 'character width' of the font is defined as the width of the widest numeral character in the font. Because font sizes and point values don't always convert cleanly, you should expect some small error (usually less than a point) when using this property in conjunction with [{{StandardWidth}}|Worksheet.StandardWidth]. {remarks} |
Page History
Overview
Content Tools