123
-=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- (c) WidthPadding Industries 1987 0|530|0 -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=-
Socoder -> Basic Basement -> vb.net listview text limit?

Sun, 31 Jan 2010, 05:04
spinal
Does anyone know if there is a way to limit the amount of text a user can input into an editable listview item?

I'm using the following to start editing the item.



I would like to limit the string length to about 32 characters but I can't find anything anywhere about doing that.

-=-=-
Check out my excellent homepage!
Sun, 31 Jan 2010, 05:09
JL235
I don't know .NET, so I don't how you'd implement this. But presumably you can add an event that will run after a character has been entered? You could have an event defined that will just get the string stored, check if it's longer then 32, and set a shorter string back if it is.

That's how I'd do it in Java.
Sun, 31 Jan 2010, 05:30
Phoenix
Doesn't seem to be possible in a simple way. The easy solution would be to cut off excess characters when the user has finished typing.
Sun, 31 Jan 2010, 06:03
spinal
hehe, I can't even find any info on knowing when the user has finished editing the item

-=-=-
Check out my excellent homepage!
Sun, 31 Jan 2010, 06:34
Phoenix
msdn.microsoft.com/en-us/library/system.windows.forms.listview.afterlabeledit%28VS.100%29.aspx

Something like this could work (untested):


|edit| Oops, sorry -- didn't realize you were using VB.NET. You'll have to convert the code yourself, or write something equivalent. |edit|