humm.... im not sure if you can...but if you can you could check the len(string$) to see how big it is.... but i dont think you can restrict the amount of characters in the edit box.
I could be very wrong.... I would actually look into making your own text capture if you have the time to. have a look at my code i used to create a keyboard input from scratch... maybe you will find some of the code usefull?
here is the link:
http://forum.thegamecreators.com/?m=forum_view&t=210973&b=41
it says its for the ouya but it can capture from all input methods....touch,mouse, and joystick