Computer Science Canada Recreating the 'Show Possibilities As You type' effect |
Author: | GlobeTrotter [ Mon Jun 20, 2005 8:17 pm ] | ||
Post subject: | Recreating the 'Show Possibilities As You type' effect | ||
This is trying to recreate the effect, when you, are given possibilities as you type, in the form of hilighted text. I wrote a procedure to do so, and it is called in the text_change event, but the problem is that the user can't use the delete/backspace key when it's is in use. I realize the problem is that it is assigning the hilighted text after you press delete, so I need a way of recognizing when the user has deleted text, so that the procedure won't be called when it has been. This is the procedure, you input the textbox name and the sorted array of string possibilities. Call it in the text_change event.
I would appreciate any help, please. |
Author: | GlobeTrotter [ Tue Aug 16, 2005 10:54 pm ] |
Post subject: | |
Could I please have some help, this has been here for a while and has only gotten 9 views! |
Author: | [Gandalf] [ Wed Aug 17, 2005 4:34 pm ] |
Post subject: | |
Sorry, but I can't help since I don't have any VB knowledge. The problem is that not too many people here VB here... Maybe try detecting the length of the text continuously, and when there is less characters than there was previously you know that the user has deleted some text. |
Author: | Tony [ Thu Aug 18, 2005 9:29 am ] |
Post subject: | |
Well you could keep track of the cursor's position. If it suddenly goes to the left instead of expected right, the user must have backspaced a letter (or just clicked somewhere else) |
Author: | [Gandalf] [ Thu Aug 18, 2005 12:35 pm ] |
Post subject: | |
Yep, that's why I chose to detect the amount of letters in the string (or whatever it is) instead. When there are less than there were previously, you know for sure that the user deleted a letter. |
Author: | wtd [ Sat Aug 27, 2005 1:44 am ] |
Post subject: | |
If you're using VB.NET, I strongly suggest you ditch VB and use C#. Seriously. You'll thank me. |