Bagikan melalui


Block.IsHyphenationEnabled Properti

Definisi

Mendapatkan atau menetapkan nilai yang menunjukkan apakah tanda hubung otomatis kata diaktifkan atau dinonaktifkan.

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

Nilai Properti

true jika pemecahan otomatis dan tanda hubung kata diaktifkan; jika tidak, false. Defaultnya adalah false.

Contoh

Contoh berikut menunjukkan cara mengatur IsHyphenationEnabled atribut Block elemen.

<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>

Gambar berikut menunjukkan bagaimana contoh sebelumnya dirender.

Cuplikan layar: Cuplikan layar yang diaktifkan tanda hubung FlowDocument

Gambar berikut menunjukkan bagaimana contoh yang sama dirender dengan pengaturan IsHyphenationEnabled=falsedefault .

Cuplikan layar: FlowDocument dengan cuplikan layar tanda hubung yang dinonaktifkan

Contoh berikut menunjukkan cara mengatur properti IsHyphenationEnabled secara terprogram.

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

Keterangan

Fitur tanda hubung kata otomatis memungkinkan Block elemen untuk secara otomatis memecah dan menghubungkan kata-kata, berdasarkan kondisi tata letak saat ini. Ini memungkinkan kata-kata panjang dimulai pada satu baris dan melanjutkan hal ini berikutnya, dan cenderung mencapai distribusi spasi kosong yang lebih merata dalam teks yang dibenarkan. Kata-kata rusak dan dipendam sesuai dengan aturan tata bahasa standar.

Informasi Properti Dependensi

Item Nilai
Bidang pengidentifikasi IsHyphenationEnabledProperty
Properti metadata diatur ke true AffectsMeasure, , AffectsRenderInherits

Berlaku untuk