The problem is that "lines" is a nebulous concept when you use a multiline textbox: because what the text box thinks of as a "line" is delimited by a '\n' character entered by the user using the ENTER key - but as far as the display goes it includes word wrap, so a single line of text may display over a dozen "lines" in the running application.
If you want to restrict the user input to a number of "lines" regardless, then you will need to use the
Graphics.MeasureString[
^] method in conjunction with the text entered and the TextBox.Font property to determine the display size of the actual text.
This will not be as simple as it sounds: you will need to work with the line characters the user has entered, as well as the size of the textbox, and remember to Dispose the graphics context you create each time or you will run out of memory extremely quickly!