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)

適用対象