RichTextBoxStreamType 列挙体とは? わかりやすく解説

Weblio 辞書 > コンピュータ > .NET Framework クラス ライブラリ リファレンス > RichTextBoxStreamType 列挙体の意味・解説 

RichTextBoxStreamType 列挙体

RichTextBox コントロールで、データ読み込みおよび保存使用される入出力ストリームの型を指定します

名前空間: System.Windows.Forms
アセンブリ: System.Windows.Forms (system.windows.forms.dll 内)
構文構文

Public Enumeration RichTextBoxStreamType
Dim instance As RichTextBoxStreamType
public enum RichTextBoxStreamType
public enum class RichTextBoxStreamType
public enum RichTextBoxStreamType
public enum RichTextBoxStreamType
メンバメンバ
解説解説

この列挙体のメンバは、RichTextBox コントロールの LoadFile メソッドおよび SaveFile メソッド呼び出すときに使用します

使用例使用例

RichTextBox内容ASCII テキスト ファイル保存する例を次に示します。この例は、SaveFileDialog クラス使用してファイルパスと名前を指定するようにユーザー要求するダイアログ ボックス表示します次にコントロール内容ユーザー指定したファイル保存します。この例では、このバージョンSaveFile メソッド使用しファイル標準RTF ファイルではなく ASCII テキスト ファイルとして保存するように指定してます。この例は、コードrichTextBox1 という名前の RichTextBox コントロール保持する Form クラス内にあることを前提にしています。

Public Sub SaveMyFile()
    ' Create a SaveFileDialog to request a path and file name to save
 to.
    Dim saveFile1 As New
 SaveFileDialog()
    
    ' Initialize the SaveFileDialog to specify the RTF extension for
 the file.
    saveFile1.DefaultExt = "*.rtf"
    saveFile1.Filter = "RTF Files|*.rtf"
    
    ' Determine if the user selected a file name from the saveFileDialog.
    If (saveFile1.ShowDialog() = System.Windows.Forms.DialogResult.OK)
 _
        And (saveFile1.FileName.Length) > 0 Then
    
        ' Save the contents of the RichTextBox into the file.
        richTextBox1.SaveFile(saveFile1.FileName, _
            RichTextBoxStreamType.PlainText)
    End If
End Sub

public void SaveMyFile()
{
   // Create a SaveFileDialog to request a path and file name to save
 to.
   SaveFileDialog saveFile1 = new SaveFileDialog();

   // Initialize the SaveFileDialog to specify the RTF extension for
 the file.
   saveFile1.DefaultExt = "*.rtf";
   saveFile1.Filter = "RTF Files|*.rtf";

   // Determine if the user selected a file name from the saveFileDialog.
   if(saveFile1.ShowDialog() == System.Windows.Forms.DialogResult.OK
 &&
      saveFile1.FileName.Length > 0) 
   {
      // Save the contents of the RichTextBox into the file.
      richTextBox1.SaveFile(saveFile1.FileName, RichTextBoxStreamType.PlainText);
   }
}

public:
   void SaveMyFile()
   {
      // Create a SaveFileDialog to request a path and file name to save
 to.
      SaveFileDialog^ saveFile1 = gcnew SaveFileDialog;
      
      // Initialize the SaveFileDialog to specify the RTF extension for
 the file.
      saveFile1->DefaultExt = "*.rtf";
      saveFile1->Filter = "RTF Files|*.rtf";
      
      // Determine if the user selected a file name from the saveFileDialog.
      if ( saveFile1->ShowDialog() == System::Windows::Forms::DialogResult::OK
 &&
         saveFile1->FileName->Length > 0 )
      {
         // Save the contents of the RichTextBox into the file.
         richTextBox1->SaveFile( saveFile1->FileName, RichTextBoxStreamType::PlainText
 );
      }
   }
public void SaveMyFile()
{
    // Create a SaveFileDialog to request a path and file name to save
 to.
    SaveFileDialog saveFile1 = new SaveFileDialog();

    // Initialize the SaveFileDialog to specify the RTF extension for
 the 
    // file.
    saveFile1.set_DefaultExt("*.rtf");
    saveFile1.set_Filter("RTF Files|*.rtf");

    // Determine if the user selected a file name from the saveFileDialog.
    if (saveFile1.ShowDialog() == 
        System.Windows.Forms.DialogResult.OK && 
        saveFile1.get_FileName().length() > 0) {
            // Save the contents of the RichTextBox into the file.
            richTextBox1.SaveFile(
                saveFile1.get_FileName(), RichTextBoxStreamType.PlainText);
    }
} //SaveMyFile
プラットフォームプラットフォーム
バージョン情報バージョン情報
参照参照



英和和英テキスト翻訳>> Weblio翻訳
英語⇒日本語日本語⇒英語
  

辞書ショートカット

すべての辞書の索引

「RichTextBoxStreamType 列挙体」の関連用語

RichTextBoxStreamType 列挙体のお隣キーワード
検索ランキング

   

英語⇒日本語
日本語⇒英語
   



RichTextBoxStreamType 列挙体のページの著作権
Weblio 辞書 情報提供元は 参加元一覧 にて確認できます。

   
日本マイクロソフト株式会社日本マイクロソフト株式会社
© 2025 Microsoft.All rights reserved.

©2025 GRAS Group, Inc.RSS