Run コンストラクター

定義

Run クラスの新しいインスタンスを初期化します。

オーバーロード

Run()

Run クラスの新しい既定のインスタンスを初期化します。

Run(String)

テキスト ランの初期コンテンツとして指定された文字列を受け取って、Run クラスの新しいインスタンスを初期化します。

Run(String, TextPointer)

テキスト ランの初期コンテンツとして指定された文字列と、テキスト ランの挿入位置を指定する Run を受け取って、TextPointer クラスの新しいインスタンスを初期化します。

Run()

Run クラスの新しい既定のインスタンスを初期化します。

public:
 Run();
public Run ();
Public Sub New ()

適用対象

Run(String)

テキスト ランの初期コンテンツとして指定された文字列を受け取って、Run クラスの新しいインスタンスを初期化します。

public:
 Run(System::String ^ text);
public Run (string text);
new System.Windows.Documents.Run : string -> System.Windows.Documents.Run
Public Sub New (text As String)

パラメーター

text
String

Run オブジェクトの初期コンテンツを指定する文字列。

次の例では、このコンストラクターの使用方法を示します。

Run textRun = new Run("The text contents of this text run.");
Dim textRun As New Run("The text contents of this text run.")

適用対象

Run(String, TextPointer)

テキスト ランの初期コンテンツとして指定された文字列と、テキスト ランの挿入位置を指定する Run を受け取って、TextPointer クラスの新しいインスタンスを初期化します。

public:
 Run(System::String ^ text, System::Windows::Documents::TextPointer ^ insertionPosition);
public Run (string text, System.Windows.Documents.TextPointer insertionPosition);
new System.Windows.Documents.Run : string * System.Windows.Documents.TextPointer -> System.Windows.Documents.Run
Public Sub New (text As String, insertionPosition As TextPointer)

パラメーター

text
String

Run オブジェクトの初期コンテンツを指定する文字列。

insertionPosition
TextPointer

テキスト ランの作成後に、このテキスト ランを挿入する挿入位置を指定する TextPointer。自動挿入を行わない場合は null

次の例では、このコンストラクターの使用方法を示します。

// Create a new, empty paragraph to host the text run.
Paragraph par = new Paragraph();

// Get a TextPointer for the end of content in the paragraph.
TextPointer insertionPoint = par.ContentEnd;

// This line will create a new text run, initialize it with the supplied string,
// and insert it at the specified insertion point (which happens to be the end of
// content for the host paragraph).
Run textRun = new Run("The text contents of this text run.", insertionPoint);
    ' Create a new, empty paragraph to host the text run.
    Dim par As New Paragraph()

    ' Get a TextPointer for the end of content in the paragraph.
    Dim insertionPoint As TextPointer = par.ContentEnd

    ' This line will create a new text run, initialize it with the supplied string,
    ' and insert it at the specified insertion point (which happens to be the end of
    ' content for the host paragraph).
Dim textRun2 As New Run("The text contents of this text run.", insertionPoint)

適用対象