What exactly does this do?
Well first of all I must instill again that this is basic; you can take this code and modify it to fit your needs. This simply renders your basic intellesence from a populated listbox. Being that it is not complete, if someone would like to take the reigns and send me the code changes to re-publish that would be great too. My email is gary.l.coxjr at gmail dot com.
Current Known Problems:
- Intellesence is not showing below the text
- Intellesence only displays when the OemPeriod is pressed ‘.’ (would be nice to be able to press “Ctrl”+”Shift”+”Space”)
- Select from list as you type is not perfect (Doesn’t always find the right item)
- Double-Click on listbox does not post to textbox
Please keep in mind this is NOT production code and shall not be used as such. You may use this at your own risk.
What can be done to make this more useful?
Since the intellesence works off the listbox, any ListItems you load in there will be displayed when a period is pressed. Whatever is selected in the listbox when you hit “Space” or “Enter” is what will be entered after the period in the textbox. If you populate it with a list of object properties, like in my example of class Person, when a user types Person and then hits the period they will be presented with the pre-populated properties that can be selected.
Here is what we see:
What is this useful for anyway?
Well I think it could be very useful if your designing a template builder that allows your users to design custom email messages, or campaigns. This type of tool would allow your customer to build the template and from your backend code process it from a given business object. Take my example, assume I had a class named Person and the above template was processed. I could send personalized emails to a select group that may look like:
Welcome Gary Cox,
We have your current street listed as 123 Some Street.
Simply by parsing out the [object property] and replacing with its value of the current instance.
As always, I hope this helps someone. Happy Coding!!!