How to Open a text File into Textbox || richTextBox in C#
rashid@rashicode.com
0 Comments
c# drag text files into richtextbox, c# drop text file to read in richtextbox, c# richtextbox, drag text files into richtextbox, dragging files into richtextbox to read text in file, drop text file to read in richtextbox, how to export richtextbox text to text file in c#, how to open text file in textbox or richtextbox in c#, how to open word file in c# windows application, how to read a text file in c#, load word document in richtextbox c#, open a word file in richtextbox c#, open word document in richtextbox c#, open word file in richtextbox c#, printing text example in a windows form c#, read text file in a textbox in c#, richtextbox, richtextbox in c#, text, write text in ms word using c# windows form

How to Open a text File into Textbox || richTextBox in C#
Hello friend’s this is Rashid Hussain come with another video tutorial. In this tutorial I’ll show you how to open text or word file in RichTextBox or TextBox in c# winform application.
Create new windows Form application in visual studio. follow the steps
drag Button and RichTextBox from toolbox and design them.

Form.cs Code
using System; using System.Collections.Generic; using System.ComponentModel; using System.Data; using System.Drawing; using System.IO; using System.Linq; using System.Text; using System.Threading.Tasks; using System.Windows.Forms; namespace OpenTextFile { public partial class Form1 : Form { public Form1() { InitializeComponent(); } private void button1_Click(object sender, EventArgs e) { OpenFileDialog openFileDialog = new OpenFileDialog(); if (openFileDialog.ShowDialog()==DialogResult.OK) { string text = File.ReadAllText(openFileDialog.FileName); richTextBox1.Text = text; } } } }
Video tutorial
Thank you for reading this article. Please don’t forget to subscribe our official YouTube Channel RashiCode