Share via


FlowDocument.ColumnGap 屬性

定義

取得或設定欄間距值,這個值表示 FlowDocument 中各欄的間距。

public:
 property double ColumnGap { double get(); void set(double value); };
[System.ComponentModel.TypeConverter(typeof(System.Windows.LengthConverter))]
[System.Windows.Localizability(System.Windows.LocalizationCategory.None, Readability=System.Windows.Readability.Unreadable)]
public double ColumnGap { get; set; }
[<System.ComponentModel.TypeConverter(typeof(System.Windows.LengthConverter))>]
[<System.Windows.Localizability(System.Windows.LocalizationCategory.None, Readability=System.Windows.Readability.Unreadable)>]
member this.ColumnGap : double with get, set
Public Property ColumnGap As Double

屬性值

欄間距 (以與裝置無關的像素為單位)。 NaN 的值 (相當於 "Auto" 的屬性 (attribute) 值) 指出欄間距等於 LineHeight 屬性 (property)。 預設值為 NaN

屬性

範例

下列範例示範如何以程式設計方式設定 ColumnGap 屬性。

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;
Dim flowDocColGap As New FlowDocument(New Paragraph(New Run("A bit of text content...")))
    ' Set the desired column gap to 10 device independend pixels.
flowDocColGap.ColumnGap = 10.0

備註

取得這個屬性會傳回目前的資料行間距。 設定此值會變更目前有效的資料行間距,而且可能會導致內容重新排流。

資料行間距不能超過目前的 PageWidth 減去任何 PagePadding 。 如果屬性的值 ColumnGap 超過此限制,則會減少有效的資料行間距,以觀察此限制。

如果 ColumnWidthnull ,這個屬性就不會有任何作用。

XAML Attribute Usage

<object ColumnGap="double"/>  
- or -  
<object ColumnGap="qualifiedDouble"/>  
- or -  
<object ColumnGap="Auto"/>  

XAML 值

double
Double

值等於或大於 0.0 但小於 Double.PositiveInfinityDouble 字串表示。 不合格的值是以裝置獨立圖元來測量。 字串不需要明確包含小數點。

qualifiedDouble
上述的 雙精度 浮點數 (,除了) 以外 Auto ,後面接著下列其中一個單位規範: px 、、 incmpt

px (預設) 是裝置獨立單位 (,每個單位 1/96 英吋)

in 為英吋;1in==96px

cm 為公分;1cm== (96/2.54) px

pt 為點;1pt== (96/72) px

自動
使資料行之間的有效間距設定為 屬性的 LineHeight 目前值。 相當於 的 NaN 屬性值。

相依性屬性資訊

識別碼欄位 ColumnGapProperty
設定為 的中繼資料屬性 true AffectsRender

適用於

另請參閱