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.
This topic has not yet been rated - Rate this topic

FlowDocument.IsColumnWidthFlexible Property

Gets or sets a value that indicates whether the ColumnWidth value is flexible or fixed.

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

public bool IsColumnWidthFlexible { get; set; }
/** @property */
public boolean get_IsColumnWidthFlexible ()

/** @property */
public void set_IsColumnWidthFlexible (boolean value)

public function get IsColumnWidthFlexible () : boolean

public function set IsColumnWidthFlexible (value : boolean)

<object IsColumnWidthFlexible="bool" .../>

Property Value

true to indicate that the column width is flexible; false to indicate that the column width is fixed. The default value is true.

The IsColumnWidthFlexible property determines the manner in which any excess content area width (that is, the difference between the page width and the width of the content after it is laid out) is distributed amongst columns. A setting of true means that the extra space is distributed equally to each column; in this case, columns may be sized wider than the width specified by the ColumnWidth property. A setting of false means excess space is distributed to the padding on the right side of the page; in this case, columns will always size to the width specified by the ColumnWidth property (so long as that width is smaller than the width of the page minus any PagePadding).

The following figure illustrates the difference in layout when this property is true or false. Light blue represents columns of content in a FlowDocument.

Screenshot: Compare IsColumnWidthFlexible values

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

The following example shows how to set the IsColumnWidthFlexible attribute of a FlowDocument element.

<FlowDocumentReader>
  <FlowDocument
    IsColumnWidthFlexible="True"
    PageWidth="400"
    ColumnWidth="100"
    PagePadding="0"
  >
    <Paragraph>
      If <Bold>IsColumnWidthFlexible</Bold> is false, this FlowDocument will always
      have 4 columns of width 100.  Because <Bold>IsColumnWidthFlexible</Bold> is true,
      this FlowDocument may be laid out such that the width of the is more than 100, resluting in
      fewer than 4 columns.
    </Paragraph>
  </FlowDocument>
</FlowDocumentReader>

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

FlowDocument flowDoc = new FlowDocument(new Paragraph(new Run("A bit of text content...")));
// Set minimum column width to 140 pixels.
flowDoc.IsColumnWidthFlexible = true;

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
Did you find this helpful?
(1500 characters remaining)
Thank you for your feedback

Community Additions

Show:
© 2014 Microsoft. All rights reserved.