1

I was wondering if there was a way to limit the text lines/rows in a Multiline-TextBoxt to like 200 as in .Net? I was trying to set the amount of rows that would be allowed in the box.

$userTextBox.Lines.Length = ?

Is something like this possible?

1 Answer 1

3

If there isn't a built-in way then you can try and limit it yourself with an event handler that ignores key presses if the current pressed key is the Enter key (13):

$textbox_KeyDown={

    if($_.KeyValue -eq 13 -and $textbox.Lines.Count -ge 200) 
    {
       $_.SuppressKeyPress=$true
    }
}
Sign up to request clarification or add additional context in comments.

Comments

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.