Bonjour à tous,

Je n'arrive pas à écrire dans un RichTextBox après avoir sélectionné le fichier . Voici le code, dites moi je vous en prie, ce que je dois faire.

Code C# : Sélectionner tout - Visualiser dans une fenêtre à part
1
2
3
4
5
6
7
8
9
10
11
12
13
private void Form1_Load(object sender, EventArgs e)
        {
            RichTextBox richTextBox1 = new RichTextBox();
            // Create an OpenFileDialog object.
            OpenFileDialog openFile1 = new OpenFileDialog();
 
            // Initialize the filter to look for text files.
            openFile1.Filter = "Text Files|*.txt";
 
            // If the user selected a file, load its contents into the RichTextBox. 
            if (openFile1.ShowDialog() == System.Windows.Forms.DialogResult.OK)
                richTextBox1.LoadFile(openFile1.FileName,RichTextBoxStreamType.PlainText);
        }