TECHNOLOGIES
FORUMS
JOBS
BOOKS
EVENTS
INTERVIEWS
Live
MORE
LEARN
Training
CAREER
MEMBERS
VIDEOS
NEWS
BLOGS
Sign Up
Login
No unread comment.
View All Comments
No unread message.
View All Messages
No unread notification.
View All Notifications
Answers
Post
An Article
A Blog
A News
A Video
An EBook
An Interview Question
Ask Question
Forums
Monthly Leaders
Forum guidelines
onez
NA
73
0
ReadLine TextBox
Dec 4 2004 1:56 AM
I want a RichTextBox to behave like a console window and read a line. This is my first try at threads so it didn't work and skips the method. Should I not use a thread? bool READING = false; string READ_str; public string RL() { READ_str = ""; READING = true; ThreadStart w1 = new ThreadStart(Loop_th); Thread t1 = new Thread(w1); t1.Start(); return READ_str; } public void Loop_th() { while (READING) { Debug.WriteLine("READING: " + READING.ToString()); if (!READING) break; } } private void m_textbox_KeyDown(object sender, KeyEventArgs e) { if (READING) { string read_ch = e.KeyValue.ToString(); c.w("Read: " + read_ch + ", " + e.KeyCode.ToString()); if (e.KeyCode == Keys.Enter) { c.w("Pressed enter"); READING = false; } else { READ_str += read_ch; c.w("Readstr: " + READ_str); } } }
Reply
Answers (
6
)
Socket programming for .Net Framework
Is it possible to open Acrobat Reader inside a form in C#?