Remove line from multiline textbox

J

jenp

I don't think you can do this - the value of a text box (multiline or
not) is one long string. I'd be tempted to use a ListBox, which allows
for manipulation of individual items.

I suppose you could split the string in the text box using the \r\n
characters for a carriage return\newline, and delete the correct part -
but a ListBox would be a much more efficient solution.
 
I

Ignacio Machin \( .NET/ C# MVP \)

Hi,

Sale said:
How can i remove specific line from the multiline textbox?

textbox1.Text = textbox1.Text.Remove( startIndex, length );

All you have to do is know where the line start and how big it's
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top