Click here to Skip to main content
15,895,283 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
there's a richtextbox compenent,I want to show the progress of the load file.
i tried other method such as:
1. File.ReadAllText
2. StreamReader.ReadToEnd
3. StreamReader.ReadLine
4. richtextbox.LoadFile
but it cann't show progress.
And, obviously, I test the loading time, one line of reading the file data is the slowest method, I have to take into account the speed of loading.
how to achieve my purpuse,tks for answer.

remark:it's c# winform application

What I have tried:

create a thread,and calculate richtextbox.text.leng/FileInfo(filepathe).Length.
but i cann't show progress
Posted
Updated 21-Sep-16 22:33pm
v2

1 solution

 
Share this answer
 
Comments
xuyunhai20160827 22-Sep-16 5:14am    
i'm not mean like this.
progressbar is compenent to show,but i need calculate richtextbox.text.leng/FileInfo(filepathe).Length,and give the result to progreesbar.value.
but how to calculate the result when use the method as above?
Richard MacCutchan 22-Sep-16 5:36am    
What do you mean "how to calculate"? That is basic mathematics.
xuyunhai20160827 22-Sep-16 5:57am    
for example,when you use richtextbox.LoadFile,how to show the progress of the load file?
where is the progress value?

you can try,and then reply to me,not just reply without try.
Richard MacCutchan 22-Sep-16 6:35am    
There is no progress information from the LoadFile. You would need to load the file manually and check progress in your code. However it would need to be an extremely large file to make this worthwhile.

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900