Question

I have a TreeView and a list view controls that both supports edit their item nodes, but I want to limit them to 256 characters max, one way to do it, is to validate the Length of the string in the OnAfterLabelEdit, but what I want to do it make the edit box stop accepting characters when it reaches 256. same as

TextBox.Maxlength

Was it helpful?

Solution

There is no easy way to do that with TreeView/ListView items unlike with TextBoxes. You could either try TVITEM structure or this. Or you could capture the text changed event and validate...

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top