Click here to Skip to main content
15,886,199 members
Home / Discussions / C#
   

C#

 
AnswerRe: RichTextBox - large string loading problem Pin
sam#27-Feb-07 0:45
sam#27-Feb-07 0:45 
AnswerRe: RichTextBox - large string loading problem Pin
sam#27-Feb-07 0:45
sam#27-Feb-07 0:45 
GeneralRe: RichTextBox - large string loading problem Pin
mav.northwind27-Feb-07 1:17
mav.northwind27-Feb-07 1:17 
GeneralRe: RichTextBox - large string loading problem Pin
Luc Pattyn27-Feb-07 2:16
sitebuilderLuc Pattyn27-Feb-07 2:16 
QuestionRe: RichTextBox - large string loading problem Pin
Darko_R27-Feb-07 8:26
Darko_R27-Feb-07 8:26 
AnswerRe: RichTextBox - large string loading problem Pin
mav.northwind27-Feb-07 9:39
mav.northwind27-Feb-07 9:39 
GeneralRe: RichTextBox - large string loading problem Pin
sam#27-Feb-07 2:37
sam#27-Feb-07 2:37 
GeneralRe: RichTextBox - large string loading problem Pin
mav.northwind27-Feb-07 9:23
mav.northwind27-Feb-07 9:23 
Smile | :) Ok, then please show us a working example. If you don't use a workaround like the one suggested by Luc (which isn't what the poster was asking for and, honestly, I'd rather call cheating :P), I really can't see how this should work.

Sure, "use threads" is the default answer when someone ask for making something more responsive, but in this case it's a Control that can become unresponsive for a longer period of time due to calling one of its methods (or setting one of its properties).
With very few exceptions (and calling LoadFile() or setting Rtf don't belong to them) you cannot safely access a control from another thread than the one it was created on.
So if you create the RTB in another thread (apart from the UIThread), then you'll have to marshal each and every call to this other thread.
But even so: You're calling LoadFile() from the other thread and the RTB is blocking the other thread while the large file is being loaded. During this period of time the RTB doesn't update and thus appears unresponsive.

Out of curiosity I actually tried the "create the RTB in another thread" approach and, apart from proving my point, I also found that even the UIThread seems to be blocked while the RTB is loading a large file in a background thread...

If you're interested, I can post the code here.


Regards,
mav

--
Black holes are the places where God divided by 0...

GeneralRe: RichTextBox - large string loading problem Pin
sam#28-Feb-07 1:10
sam#28-Feb-07 1:10 
GeneralRe: RichTextBox - large string loading problem Pin
mav.northwind28-Feb-07 6:29
mav.northwind28-Feb-07 6:29 
GeneralRe: RichTextBox - large string loading problem Pin
sam#28-Feb-07 21:09
sam#28-Feb-07 21:09 
GeneralRe: RichTextBox - large string loading problem Pin
mav.northwind3-Mar-07 7:20
mav.northwind3-Mar-07 7:20 
Questioninheritance Issue Pin
tcss26-Feb-07 20:43
tcss26-Feb-07 20:43 
AnswerRe: inheritance Issue Pin
tcss26-Feb-07 21:33
tcss26-Feb-07 21:33 
GeneralRe: inheritance Issue Pin
Jakub Mller26-Feb-07 23:43
Jakub Mller26-Feb-07 23:43 
GeneralRe: inheritance Issue Pin
tcss2-Mar-07 8:27
tcss2-Mar-07 8:27 
QuestionHow to get the instance of a running process ? Pin
Mr Perfect26-Feb-07 17:22
Mr Perfect26-Feb-07 17:22 
AnswerRe: How to get the instance of a running process ? Pin
Sandeep Akhare26-Feb-07 19:24
Sandeep Akhare26-Feb-07 19:24 
AnswerRe: How to get the instance of a running process ? Pin
Sven Cipido26-Feb-07 20:57
Sven Cipido26-Feb-07 20:57 
AnswerRe: How to get the instance of a running process ? Pin
wasife26-Feb-07 23:26
wasife26-Feb-07 23:26 
AnswerRe: How to get the instance of a running process ? Pin
Martin#26-Feb-07 23:38
Martin#26-Feb-07 23:38 
QuestionCreate FTP Site from website Pin
LoneWolfAGQ226-Feb-07 13:04
LoneWolfAGQ226-Feb-07 13:04 
AnswerRe: Create FTP Site from website Pin
mike montagne26-Feb-07 13:27
mike montagne26-Feb-07 13:27 
QuestionRe: Create FTP Site from website Pin
LoneWolfAGQ227-Feb-07 8:11
LoneWolfAGQ227-Feb-07 8:11 
GeneralNeed help. Hit learning barrier. [modified] Pin
JMOdom26-Feb-07 10:58
JMOdom26-Feb-07 10:58 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.