Click here to Skip to main content
15,891,816 members
Please Sign up or sign in to vote.
1.00/5 (1 vote)
See more:
can i use stream reader readtoend method on textbox in text_changed event so that it doesn't fire with the first char and fires after it reads all the string ?
Posted
Comments
Sandeep Mewara 19-Apr-11 4:12am    
Can you elaborate more? Use Improve question and edit the question.

There is nothing to read in a text box using the stream. (Well you, can create a memory stream — makes no sense.) There is no such event "text_changed" (but I understand what are you talking about). Event is not fired on read of anything; this event if fired when a character is typed (or removed by backspace, but not Del, etc.).

From your Question I can see you have no idea of streams and events, and probably properties. You cannot develop and UI until you learn all that. I have no better idea — learn it. You're not prepared to ask sensible questions on the level you're trying to. Please, don't waste your time, step back. You will come to UI soon enough if you understand the basics really well. Come back when you're confident with basic programming; we would be happy to help.

—SA
 
Share this answer
 
Comments
Espen Harlinn 19-Apr-11 16:34pm    
My 5 and congratulations on reaching 100K
Sergey Alexandrovich Kryukov 19-Apr-11 16:56pm    
Thank you very much, Espen.

But 100K is 102400, according to my calculator :-) Do I miss anything? What so special about this figure? Perhaps you're referring to some "round" number, but which one?
The nearest round number was 0x10000 = 1 << 16, next one will be less rounded: 1 << 17 = 0x20000 = 131072, not so soon... :-)

Thank you!
--SA
Nope, use LostFocus event of the TextBox.

Do it like this :

C#
public Form1()
        {
            InitializeComponent();
            textBox1.LostFocus += new EventHandler(textBox1_LostFocus);
        }
        void textBox1_LostFocus(object sender, EventArgs e)
        {
            MessageBox.Show("This is the text that you entered : " + textBox1.Text);
        }


So when the user of your application moves to some other control, you can capture the text entered using the above function.

Hope it helped!
 
Share this answer
 
v2

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