Information
The topic you requested is included in another documentation set. For convenience, it's displayed below. Choose Switch to see the topic in its original location.

FlowDocument.ColumnGap Property

Gets or sets the column gap value, which indicates the spacing between columns in a FlowDocument.

Namespace: System.Windows.Documents
Assembly: PresentationFramework (in presentationframework.dll)
XML Namespace:  http://schemas.microsoft.com/winfx/2006/xaml/presentation

[LocalizabilityAttribute(LocalizationCategory.None, Readability=Readability.Unreadable)] 
[TypeConverterAttribute(typeof(LengthConverter))] 
public double ColumnGap { get; set; }
/** @property */
public double get_ColumnGap ()

/** @property */
public void set_ColumnGap (double value)

public function get ColumnGap () : double

public function set ColumnGap (value : double)

<object ColumnGap="double"/>
- or -
<object ColumnGap="qualifiedDouble"/>
- or -
<object ColumnGap="Auto"/>
 double  String representation of a Double value equal to or greater than 0.0 but smaller than PositiveInfinity. An unqualified value is measured in device independent pixels. Strings need not explicitly include decimal points.  qualifiedDouble  A double value as described above, (excepting Auto) followed by one of the following unit specifiers: px, in, cm, pt.  px (default) is device-independent units (1/96th inch per unit)  in is inches; 1in==96px  cm is centimeters; 1cm==(96/2.54) px  pt is points; 1pt==(96/72) px Auto Causes the effective spacing between columns to be set to the current value of the LineHeight property.  Equivalent to a property value of NaN. 

Property Value

A double value indicating the column gap, in device independent pixels. Getting this property returns the current column gap. Setting this value changes the currently effective column gap, and may cause content to reflow. A value of NaN, (equivalent to an attribute value of "Auto") causes the effective spacing between columns to be set to the current value of the LineHeight property. The default value is NaN.

The column gap cannot exceed the current PageWidth minus any PagePadding. If the value of the ColumnGap property exceeds this limit, the effective column gap is reduced to observe this limit.

This property has no effect if ColumnWidth is null.

For a sample that explores the ColumnGap property in real time, see theOptimal Paragraph and Hyphenation in a FlowDocument Sample.

The following example shows how to set the ColumnGap property programmatically.

FlowDocument flowDoc = new FlowDocument(new Paragraph(new Run("A bit of text content...")));
// Set the desired column gap to 10 device independend pixels.
flowDoc.ColumnGap = 10.0;

More Code

How to: Use FlowDocument Column-Separating Attributes

This example shows how to use the column-separating features of a FlowDocument.

Windows 98, Windows Server 2000 SP4, Windows CE, Windows Millennium Edition, Windows Mobile for Pocket PC, Windows Mobile for Smartphone, Windows Server 2003, Windows XP Media Center Edition, Windows XP Professional x64 Edition, Windows XP SP2, Windows XP Starter Edition

The Microsoft .NET Framework 3.0 is supported on Windows Vista, Microsoft Windows XP SP2, and Windows Server 2003 SP1.

.NET Framework

Supported in: 3.0
Was this page helpful?
(1500 characters remaining)
Thank you for your feedback

Community Additions

Show:
© 2014 Microsoft