text box custom behaviour during edition
-
Hello everyone, Im wondering if its possible to make my control behave in the way described below: during editing text when user types enter normally cursor moves to the next line creating new emtpy line and then user can keep on writing. I would like to make it possible to move to another line by typeing enter only when the current line contains 10 characters. Hope taht my description of the problem is clear, thanks for any hint, Witek
-
Hello everyone, Im wondering if its possible to make my control behave in the way described below: during editing text when user types enter normally cursor moves to the next line creating new emtpy line and then user can keep on writing. I would like to make it possible to move to another line by typeing enter only when the current line contains 10 characters. Hope taht my description of the problem is clear, thanks for any hint, Witek
-
Hello everyone, Im wondering if its possible to make my control behave in the way described below: during editing text when user types enter normally cursor moves to the next line creating new emtpy line and then user can keep on writing. I would like to make it possible to move to another line by typeing enter only when the current line contains 10 characters. Hope taht my description of the problem is clear, thanks for any hint, Witek
Hi Witek, Use events of Keys (KeyDown or KeyPress or may be you may use TextChanged event) and check for the conditions (if the control contains 10 characters or so). Then put the code for execution, may be forcing a line break or something as per the requirements. I hope this would be helpful.
John Adams ComponentOne LLC. www.componentone.com
-
Hello everyone, Im wondering if its possible to make my control behave in the way described below: during editing text when user types enter normally cursor moves to the next line creating new emtpy line and then user can keep on writing. I would like to make it possible to move to another line by typeing enter only when the current line contains 10 characters. Hope taht my description of the problem is clear, thanks for any hint, Witek
As the others have mentioned, wire together logic in the KeyDown event procedure. You'll have to make sure the textbox is set to handle multiple lines, as well.
"The clue train passed his station without stopping." - John Simmons / outlaw programmer "Real programmers just throw a bunch of 1s and 0s at the computer to see what sticks" - Pete O'Hanlon "Not only do you continue to babble nonsense, you can't even correctly remember the nonsense you babbled just minutes ago." - Rob Graham