共用方式為


Block.IsHyphenationEnabled 屬性

定義

取得或設定值,此值會指出是否啟用或停用字詞的自動斷字。

public:
 property bool IsHyphenationEnabled { bool get(); void set(bool value); };
public bool IsHyphenationEnabled { get; set; }
member this.IsHyphenationEnabled : bool with get, set
Public Property IsHyphenationEnabled As Boolean

屬性值

如果啟用自動斷字則為 true,否則為 false。 預設為 false

範例

下列範例示範如何設定 IsHyphenationEnabled 專案的 屬性 Block

<FlowDocument
  TextAlignment="Justify" 
  IsOptimalParagraphEnabled="True"
  Background="LightGray"
  PageWidth="400" PageHeight="480"
>
  <Paragraph IsHyphenationEnabled="True">
    <Hyperlink NavigateUri="http://www.xbox.com/en-US/games/p/perfectdarkzero/default.htm">
      Perfect Dark Zero
    </Hyperlink>
  </Paragraph>
  <Paragraph IsHyphenationEnabled="True">
    Joanna Dark returns in the Xbox 360 exclusive <Bold>
      <Italic>Perfect Dark Zero</Italic>
    </Bold>, the
    prequel to the internationally award-winning and multi-million selling first-person shooter
    <Italic>Perfect Dark</Italic> from famed game developer Rare.
  </Paragraph>
  <Paragraph IsHyphenationEnabled="True">
    A secret war has begun between shadowy corporations bent on world domination. Joanna Dark and her father
    Jack are caught up in the fight for the future of the planet. A routine bounty hunting mission rips open
    a global conspiracy that will change Joanna's destiny—forever.
  </Paragraph>
  <Paragraph IsHyphenationEnabled="True">
    Guide Joanna Dark on her journey to become the perfect agent. Featuring a compelling and captivating story,
    <Italic>Perfect Dark Zero</Italic> plunges you into a world of corporate espionage and conspiracy. The title
    merges the excitement and intrigue of its predecessor with revolutionary game design, cutting-edge online play,
    and amazing graphics to deliver an experience that defines next-generation gaming and entertainment...
  </Paragraph>
</FlowDocument>

下圖顯示上述範例的呈現方式。

螢幕擷取畫面:已啟用 FlowDocument 連字號的

下圖顯示相同範例如何以 的預設設定 IsHyphenationEnabled=false 呈現。

螢幕擷取畫面:具有停用連字號的 FlowDocument

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

Paragraph par = new Paragraph();
par.IsEnabled = true;
Dim par As New Paragraph()
par.IsEnabled = True

備註

自動字連字功能可讓 Block 元素根據目前的版面配置條件自動中斷和連字號字。 這可讓長字從一行開始,並繼續進行下一行,而且通常會在對齊文字中達到更平均的空白字元分佈。 文字會根據標準文法規則中斷和連字號。

相依性屬性資訊

識別碼欄位 IsHyphenationEnabledProperty
設定為 的中繼資料屬性 true AffectsMeasure, AffectsRender, Inherits

適用於