Aracılığıyla paylaş


MinMaxParagraphWidth.MinWidth Özellik

Tanım

Belirtilen metin içeriğini tam olarak içerebilecek en küçük paragraf genişliğini alır.

public:
 property double MinWidth { double get(); };
public double MinWidth { get; }
member this.MinWidth : double
Public ReadOnly Property MinWidth As Double

Özellik Değeri

Double

Double Mümkün olan en küçük paragraf genişliğini temsil eden bir.

Örnekler

Aşağıdaki örnekte, biçimlendirilmiş metin satırları için en düşük paragraf genişliğini oluşturmak üzere özelliğinin nasıl kullanılacağı MinWidth gösterilmektedir.

MinMaxParagraphWidth minMaxParaWidth =
    formatter.FormatMinMaxParagraphWidth(customTextSource, 0, customTextParagraphProperties);

// Format each line of text from the text store and draw it.
while (textStorePosition < customTextSource.Text.Length)
{
    // Create a textline from the text store using the TextFormatter object.
    using (TextLine myTextLine = formatter.FormatLine(
        customTextSource,
        textStorePosition,
        minMaxParaWidth.MinWidth,
        customTextParagraphProperties,
        null))
    {
        // Draw the formatted text into the drawing context.
        myTextLine.Draw(drawingContext, linePosition, InvertAxes.None);

        // Update the index position in the text store.
        textStorePosition += myTextLine.Length;

        // Update the line position coordinate for the displayed line.
        linePosition.Y += myTextLine.Height;
    }
}
Dim minMaxParaWidth As MinMaxParagraphWidth = formatter.FormatMinMaxParagraphWidth(customTextSource, 0, customTextParagraphProperties)

' Format each line of text from the text store and draw it.
Do While textStorePosition < customTextSource.Text.Length
    ' Create a textline from the text store using the TextFormatter object.
    Using myTextLine As TextLine = formatter.FormatLine(customTextSource, textStorePosition, minMaxParaWidth.MinWidth, customTextParagraphProperties, Nothing)
        ' Draw the formatted text into the drawing context.
        myTextLine.Draw(drawingContext, linePosition, InvertAxes.None)

        ' Update the index position in the text store.
        textStorePosition += myTextLine.Length

        ' Update the line position coordinate for the displayed line.
        linePosition.Y += myTextLine.Height
    End Using
Loop

Açıklamalar

En küçük paragraf genişliği, metin içeriğinde en büyük genişliğe sahip sözcüğe karşılık gelir.

Şunlara uygulanır