Click here to Skip to main content
15,892,768 members
Home / Discussions / C#
   

C#

 
QuestionUser Control [modified] Pin
fjlv200526-Feb-07 23:03
fjlv200526-Feb-07 23:03 
AnswerRe: User Control Pin
stancrm26-Feb-07 23:09
stancrm26-Feb-07 23:09 
GeneralRe: User Control Pin
fjlv200526-Feb-07 23:33
fjlv200526-Feb-07 23:33 
GeneralRe: User Control Pin
Christian Graus26-Feb-07 23:44
protectorChristian Graus26-Feb-07 23:44 
Questionerrorlist Pin
kalyanit26-Feb-07 22:58
kalyanit26-Feb-07 22:58 
AnswerRe: errorlist Pin
Colin Angus Mackay26-Feb-07 23:21
Colin Angus Mackay26-Feb-07 23:21 
QuestionHow to pass attributes to an exe?? Pin
Neha_Gupta26-Feb-07 22:17
Neha_Gupta26-Feb-07 22:17 
AnswerRe: How to pass attributes to an exe?? Pin
althamda26-Feb-07 22:38
althamda26-Feb-07 22:38 
AnswerRe: How to pass attributes to an exe?? Pin
Stefan Troschuetz26-Feb-07 22:48
Stefan Troschuetz26-Feb-07 22:48 
AnswerRe: How to pass attributes to an exe?? Pin
Martin#26-Feb-07 23:17
Martin#26-Feb-07 23:17 
QuestionRichTextBox - large string loading problem Pin
Darko_R26-Feb-07 21:58
Darko_R26-Feb-07 21:58 
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 

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.