I'm using a System.Windows.Forms.TextBox. According to the docs, the MaxLength property controls the amount of characters enter a user can type or paste into the TextBox (i.e. more than that can be added programmatically by using e.g. the AppendText function or the Text property). The current amount of characters can be got from the TextLength property.
- Is there any way to set the maximum amount of characters without making a custom limiter which calls
Clear()when the custom limit is reached? - Regardless, what is the absolute maximum it can hold? Is it only limited by memory?
- What happens when the maximum is reached / memory is full? Crash? Top x lines is cleared?
- What would be the best way to manually clear only the top x lines? Substring operation?
edit: I have tested it to hold more than 600k characters, regardless of MaxLength, at which point I manually stopped the program and asked this question.