Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

[Q] Word wrapping with text boxes

Status
Not open for further replies.

johnsun1976

Programmer
Jan 28, 2002
34
CA
Hi.. I was wondering how I can get word wrapping to work on several text boxes, so that when it gets to the end of the current text box, it'll jump to the next text box. Also, I would like it to wrap when typing in the middle it will wrap the words at the end of the current text box to the next.
Thanks
John
 
Sure, it can be done. Let me try to give you some hints to get you there. Figuring this kind of stuff out builds 'character' :)

Your text boxes will need to be multiline

First, you can approximate the number of characters each of your text boxes will hold, and when you reach that number of characters(len), you will setfocus to the next logical text box, allowing keyboard input to continue therein.

BUT!

What if this splits a word across two boxes... well, when you are withing a few characters of the end of the box, use your keypress event to scan for the spacebar to be pressed. If you are close enough to the end when the spacebar is pressed, setfocus to the next text box. See where I'm going with this?
[fish] No Dolphins were harmed in the posting of this message... Dolphin Friendly Tuna!
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top