help
-
I want to open a text file so I am using this code OpenFileDialog openFileDialog1 = new OpenFileDialog(); openFileDialog1.InitialDirectory = "c:\\" ; openFileDialog1.Filter = "txt files (*.txt)|*.txt|All files (*.*)|*.*" ; But my application contains a richtextbox where I want to show the contents of the file How to do it
-
I want to open a text file so I am using this code OpenFileDialog openFileDialog1 = new OpenFileDialog(); openFileDialog1.InitialDirectory = "c:\\" ; openFileDialog1.Filter = "txt files (*.txt)|*.txt|All files (*.*)|*.*" ; But my application contains a richtextbox where I want to show the contents of the file How to do it
Your question not specify what do you want to do please add more info in to your question! add:You have bad title!!
-
Your question not specify what do you want to do please add more info in to your question! add:You have bad title!!
When I will click the open menu dialog box will appear where I will browse the text file.And contets of the text file will be shown in the richtextbox which the application contains
-
When I will click the open menu dialog box will appear where I will browse the text file.And contets of the text file will be shown in the richtextbox which the application contains
-
After the user selects the text file from the OpenFile dialog use the richtextbox.loadFile() method and specify the filename in the method.
Thanks & Regards, Pramod "Everyone is a genius at least once a year"
But how to store the selected file name at run time,so that I can pass the parameter to load File method
-
But how to store the selected file name at run time,so that I can pass the parameter to load File method
if (openFileDialog1.ShowDialog() == System.Windows.Forms.DialogResult.OK) { richTextBox1.LoadFile(openFileDialog1.FileName); }
You can store FileName in registryChatura Dilan SC Java Programmer
-
But how to store the selected file name at run time,so that I can pass the parameter to load File method