Friday, July 14, 2006

TextBox with Cue/Prompt

The Moth - TextBox with cue banner support for Windows Mobile

"When talking about TextBox with cue banner I thought I had done a good job at the end of the post of hinting that someone should write a pure managed version; a version that is not restricted to Windows Vista, but rather would work on WindowsCE/WindowsMobile devices (via the .NET Compact Framework of course).

Since nobody stepped up, I thought I’d tackle it myself :-). I have to say that what I thought would be a 10 minute job ended up taking 6 times as long and right about now I give up as what I have is good enough and a nice starter for someone else to take and polish, iron out any issues etc.


..."

I thought Daniel’s code to provide cues/prompts to a textbox was pretty cool.

Though he started it was for WinCE/Mobile, I wanted the same feature for my WinXP WinForm apps. In looking at the code, I didn’t see any reason it wouldn’t work...

So this morning, after a little bit of work (mostly due to converting it to VB.Net, the programming language I dream in...) I had a working TextBox control with cue support on WinXP (no reason it shouldn’t work on other Windows platforms either). After a little additional work to add designer SmartTag support and property attributes, I have myself a cool little textbox.

That will add a nice bit usability to my apps.

The next step is to convert it to an Extender so the same functionality can be used across a number of different controls. That I’ll leave for another day...

Now to see if I can get permission to post the code somewhere [long deep "I hate IP issues and contracts" sigh]...

4 comments:

The Moth said...

Hi Greg :-).

Yes it works as is with no modifications on Windows desktop as well. I state that in my blog enrty:
"explicitly tested on WM 5.0 and WinXP"

I am sure that as you use it in your VB projects you'll find issues etc. If you fix any or if you upload the VB version anywhere else then let me know please so I can update my blog post to link to it!

Greg said...

Dogh! My bad...

As for keeping you up to date on it, you've got it...

Thanks again for posting it.

Thomas said...

Hi Greg - I've been looking for something like this for a project of mine, and I work in VB too. How's progress going on this? Do you want an additional tester?

Cheers,

Thomas

Greg said...

I emailed it to you (to the email in your Blogger profile) to do with as you will (i.e. rip, tear, trash and in general make it work for you and your app...)

I hope this helps,
Greg