Max length of TextBlock

Is it possible to set a max length of chracaters to a TextBlock. The same as maxLines.

Would it suffice to use a conversion function that trimmed off all characters after some limit?

new go.Binding("text", "someProperty", function(t) { return t.substring(0, 40); })

Or are you asking about limiting the number of characters users can enter when editing the text using TextEditingTool? In that case customize the text editor by setting the textarea’s maxlength.

Hello Walter,
thanks for quick reply. I mean that with the TextEditingTool. I solved it now with the validation function shown in your second link. Finer should be to disallow maxlenght while editing, for this i have to play with the TextEditingTool understand you correct. I have to dive in, because my knowledge in pure javascript is not so good. I work with TypeScript and Angular so not all examples can take one to one.