0

I have problem with pasting data to textBox. I want to parse entered text to replace all newLines, but when I try to paste some text, let's say:

1234
5678
9000

I only get first line. Is there any easy way or I have to somehow overwrite ctrl + v shortcut and parse what im trying to input?

2
  • 1
    textbox.Multiline = true that way you get more then the first line Commented Mar 17, 2017 at 9:08
  • Try use RichTextBox Commented Mar 17, 2017 at 9:19

1 Answer 1

1

TextBox accepts one line. If you want to copy all the texts, mentioned in your question, you should enable multiline in TextBox.

Or alternatively, the multiline version of TextBox is RichTextBox (Kudos to @EpicKip).

and I think this answer helps you handle it

Sign up to request clarification or add additional context in comments.

5 Comments

There is no TextArea in winforms
TextArea you were speaking of is called RichTextBox in winforms. and also indeed multiline. But you were on the right track with TextArea :)
@EpicKip I am programming with Java and I thought that C(sharp) has also something like text area..
It does, RichTextBox :) you could add that to your answer :)
@EpicKip Yes, i have added :) Thanks.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.