The form window(chat window) that i am creating for a lan messenger is similar to the one in google talk with two textboxes. What i need to do is to transfer characters typed in the lower textbox(textbox2) to the upper textbox(textbox1 which is read-only) when i click the submit button without showing that textbox1 is read-only because the characters are appearing in grey.please help with code if possible.
Asked
Active
Viewed 432 times
-2
-
Duplicate of http://stackoverflow.com/questions/589273/read-only-textbox – lc. Feb 26 '09 at 06:18
-
it seems both questions been asked by the same person.... – M.N Feb 26 '09 at 06:21
-
unknown: please read http://stackoverflow.com/questions/469150/im-new-to-stackoverflow-what-should-i-consider-before-asking-questions – Kent Fredric Feb 26 '09 at 06:27
2 Answers
1
Use a label for this instead of a textbox. If the only thing it is doing is display the characters and not a direct edit, you won't lose any functionality and the text would not be greyed out...

RSolberg
- 26,821
- 23
- 116
- 160
-
please forward answers here: http://stackoverflow.com/questions/589273/read-only-textbox – Kent Fredric Feb 26 '09 at 06:29
1
If you're going to use a Texbox, set it to Locked. That shouldn't gray the characters out. Otherwise in KeyDown/KeyUp events, set the e.Handled property to true (which will tell the box that you want to handle the input yourself and don't want the message to filter down).
That oughta do it for you.

Cyril Gupta
- 13,505
- 11
- 64
- 87
-
please forward answers here: http://stackoverflow.com/questions/589273/read-only-textbox – Kent Fredric Feb 26 '09 at 06:30