Open a .txt file into a richTextBox in C# -
i want able open .txt file richtextbox in c# , global variable have made called 'notes' don't know how this. code have @ moment:
openfiledialog opentext = new openfiledialog(); if (opentext.showdialog() == dialogresult.ok) { richtextbox1.text = opentext.filename; globals.notes = opentext.filename; }
only problem doesn't appear in neither richtextbox nor in global varibale, , global allows viewed in richtextbox in form. please can help, ideally .txt file going both,
thanks
do mean want have text displayed or filename?
richtextbox1.text = file.readalltext(opentext.filename); globals.notes = richtextbox1.text;
you want correct to:
if (opentext.showdialog() == dialogresult.ok)
Comments
Post a Comment