I'm working in Visual Studio Express 2008. I have a RichTextBox control. The following code compiles, but the text file doesn't actually appear in the control:
TypeScript |
Thanks
TypeScript |
Know the answer? Post it. Somebody with the same question will find it here.
Answer a question in the forums and earn +20 SHARP for every answer.
See unanswered questions
DevSocialUpcoming · 3rd editionAI Agents ConferenceDec 1–3, 2026Live onlineFree to attend4days leftRegister
Jaish MathewsRank #225 · 11K reputationPosted Feb 6, 2011, 12:42 AM EST
I think it's loading, but you are not able to see it as of richtextbox control size. Do below 2 steps.
openFileDialog1.DefaultExt = ".txt";
openFileDialog1.Filter = "Text Files|*.txt";
if (openFileDialog1.ShowDialog() == DialogResult.OK)
{
try
{
richTextBox1.LoadFile(openFileDialog1.FileName,RichTextBoxStreamType.PlainText);
}
catch (ArgumentException) { }
}
Suthish NairRank #92 · 22.8K reputationPosted Feb 6, 2011, 12:53 AM EST
Suthish NairRank #92 · 22.8K reputationPosted Feb 6, 2011, 5:54 AM EST
Suthish NairRank #92 · 22.8K reputationPosted Feb 7, 2011, 12:29 AM EST
Query Resolved?
Suthish NairRank #92 · 22.8K reputationPosted Feb 7, 2011, 8:56 AM EST
Just click only once on checkbox, its ajax enabled and wait for sometime.
It will indicate with a green label as accepted answer.