Click here to Skip to main content
15,913,587 members
Home / Discussions / C#
   

C#

 
QuestionResize Objects Pin
ytubis11-Apr-09 4:53
ytubis11-Apr-09 4:53 
AnswerRe: Resize Objects Pin
0x3c011-Apr-09 4:59
0x3c011-Apr-09 4:59 
QuestionDLL Pin
Rajdeep.NET is BACK11-Apr-09 4:39
Rajdeep.NET is BACK11-Apr-09 4:39 
AnswerRe: DLL Pin
0x3c011-Apr-09 4:42
0x3c011-Apr-09 4:42 
QuestionHow I start with Crystal Report Programaticlly? Pin
magdyeltahaan11-Apr-09 3:40
magdyeltahaan11-Apr-09 3:40 
AnswerRe: How I start with Crystal Report Programaticlly? Pin
0x3c011-Apr-09 3:43
0x3c011-Apr-09 3:43 
QuestionLoad a big file to a textbox Pin
CheatCat11-Apr-09 3:23
CheatCat11-Apr-09 3:23 
AnswerRe: Load a big file to a textbox Pin
0x3c011-Apr-09 3:34
0x3c011-Apr-09 3:34 
Your program doesn't crash. You simply haven't told it to update the UI thread. Also, you're dumping the text to the RichTextBox all at once. Put that method in a separate Thread, with IsBackground set to true. Also, why are you going through line by line? You've got the file contents, replaced the nulls (which you don't actually need to do - StreamReader stops on a null character), why do you need to append it, line by line, to a StringBuilder?

What you could do is this:

  1. New thread

    1. New StreamReader
    2. Call the SuspendLayout method of the RichTextBox
    3. Read line by line. Append each line to the RichTextBox
    4. Call the ResumeLayout method of the RichTextBox
    5. Close and dispose the StreamReader


GeneralRe: Load a big file to a textbox Pin
CheatCat11-Apr-09 3:54
CheatCat11-Apr-09 3:54 
GeneralRe: Load a big file to a textbox Pin
0x3c011-Apr-09 4:22
0x3c011-Apr-09 4:22 
GeneralRe: Load a big file to a textbox Pin
Luc 64801111-Apr-09 4:37
Luc 64801111-Apr-09 4:37 
Questiongif Image Pin
Karmendra Suthar11-Apr-09 3:01
Karmendra Suthar11-Apr-09 3:01 
AnswerRe: gif Image Pin
Luc 64801111-Apr-09 3:18
Luc 64801111-Apr-09 3:18 
GeneralRe: gif Image Pin
Karmendra Suthar11-Apr-09 3:59
Karmendra Suthar11-Apr-09 3:59 
QuestionCan a control have multi parents? Pin
Duong Tien Nam11-Apr-09 1:46
Duong Tien Nam11-Apr-09 1:46 
AnswerRe: Can a control have multi parents? Pin
Luc 64801111-Apr-09 3:14
Luc 64801111-Apr-09 3:14 
GeneralRe: Can a control have multi parents? Pin
Duong Tien Nam12-Apr-09 2:39
Duong Tien Nam12-Apr-09 2:39 
AnswerRe: Can a control have multi parents? Pin
Dave Kreskowiak11-Apr-09 7:08
mveDave Kreskowiak11-Apr-09 7:08 
QuestionMultiple Radio buttons In A Form Pin
Ravindra Bisen10-Apr-09 23:31
Ravindra Bisen10-Apr-09 23:31 
AnswerRe: Multiple Radio buttons In A Form Pin
Eddy Vluggen10-Apr-09 23:58
professionalEddy Vluggen10-Apr-09 23:58 
GeneralRe: Multiple Radio buttons In A Form Pin
Ravindra Bisen11-Apr-09 1:38
Ravindra Bisen11-Apr-09 1:38 
GeneralRe: Multiple Radio buttons In A Form Pin
Eddy Vluggen11-Apr-09 6:47
professionalEddy Vluggen11-Apr-09 6:47 
AnswerRe: Multiple Radio buttons In A Form Pin
Nagy Vilmos11-Apr-09 0:24
professionalNagy Vilmos11-Apr-09 0:24 
AnswerRe: Multiple Radio buttons In A Form Pin
Luc 64801111-Apr-09 0:25
Luc 64801111-Apr-09 0:25 
GeneralRe: Multiple Radio buttons In A Form Pin
0x3c011-Apr-09 1:16
0x3c011-Apr-09 1:16 

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.