RichTextBox.RightMargin プロパティ
アセンブリ: System.Windows.Forms (system.windows.forms.dll 内)

Dim instance As RichTextBox Dim value As Integer value = instance.RightMargin instance.RightMargin = value
/** @property */ public int get_RightMargin () /** @property */ public void set_RightMargin (int value)
コントロール内の単一行のテキストのサイズ (ピクセル単位)。既定値は 0 です。


コントロールに 0 を超える値を入力すると、コントロールの左端から指定したピクセル数までの部分が、目に見えない余白として設定されます。この余白を超えて入力されたテキストは、コントロール内のテキストの次の行に表示されます。このプロパティは、その値を設定した後でコントロールに入力されたテキストだけではなく、現在入力されているすべてのテキストに適用されます。このプロパティを使用すると、RichTextBox コントロールに入力されるすべてのテキストについて行の最大幅を指定できます。

テキストが拡大表示され、コントロールのテキスト内の単語がダブルクリックされたときに単語が自動的に選択され、コントロールのクライアント領域の右側に余白がある RichTextBox を作成する方法を次のコード例に示します。RichTextBox コントロールの幅が小さい場合にこのコードを使用すると、テキストが見かけ上 1 行に 1 文字だけ表示される RichTextBox が作成されます。この垂直表示位置の場合、単語の任意の部分をクリックすると、テキストが縦書きで表示されていることにかかわらず、単語のすべての文字が選択されます。この例では、richTextBox1 という名前の RichTextBox コントロールがフォームに配置されている必要があります。
Private Sub ZoomMyRichTextBox() ' Enable users to select entire word when double clicked. richTextBox1.AutoWordSelection = True ' Clear contents of control. richTextBox1.Clear() ' Set the right margin to restrict horizontal text. richTextBox1.RightMargin = 2 ' Set the text for the control. richTextBox1.SelectedText = "Alpha Bravo Charlie Delta Echo Foxtrot" ' Zoom by 2 points. richTextBox1.ZoomFactor = 2.0F End Sub
private void ZoomMyRichTextBox() { // Enable users to select entire word when double clicked. richTextBox1.AutoWordSelection = true; // Clear contents of control. richTextBox1.Clear(); // Set the right margin to restrict horizontal text. richTextBox1.RightMargin = 2; // Set the text for the control. richTextBox1.SelectedText = "Alpha Bravo Charlie Delta Echo Foxtrot"; // Zoom by 2 points. richTextBox1.ZoomFactor = 2.0f; }
private: void ZoomMyRichTextBox() { // Enable users to select entire word when double clicked. richTextBox1->AutoWordSelection = true; // Clear contents of control. richTextBox1->Clear(); // Set the right margin to restrict horizontal text. richTextBox1->RightMargin = 2; // Set the text for the control. richTextBox1->SelectedText = "Alpha Bravo Charlie Delta Echo Foxtrot"; // Zoom by 2 points. richTextBox1->ZoomFactor = 2.0f; }
private void ZoomMyRichTextBox() { // Enable users to select entire word when double clicked. richTextBox1.set_AutoWordSelection(true); // Clear contents of control. richTextBox1.Clear(); // Set the right margin to restrict horizontal text. richTextBox1.set_RightMargin(2); // Set the text for the control. richTextBox1.set_SelectedText("Alpha Bravo Charlie Delta Echo Foxtrot"); // Zoom by 2 points. richTextBox1.set_ZoomFactor(2); } //ZoomMyRichTextBox

Windows 98, Windows 2000 SP4, Windows CE, Windows Millennium Edition, Windows Mobile for Pocket PC, Windows Mobile for Smartphone, Windows Server 2003, Windows XP Media Center Edition, Windows XP Professional x64 Edition, Windows XP SP2, Windows XP Starter Edition
開発プラットフォームの中には、.NET Framework によってサポートされていないバージョンがあります。サポートされているバージョンについては、「システム要件」を参照してください。


Weblioに収録されているすべての辞書からRichTextBox.RightMargin プロパティを検索する場合は、下記のリンクをクリックしてください。

- RichTextBox.RightMargin プロパティのページへのリンク