Controls w/option to have a default search message


Author
Message
Derek Price
Derek Price
StrataFrame User (195 reputation)StrataFrame User (195 reputation)StrataFrame User (195 reputation)StrataFrame User (195 reputation)StrataFrame User (195 reputation)StrataFrame User (195 reputation)StrataFrame User (195 reputation)StrataFrame User (195 reputation)StrataFrame User (195 reputation)
Group: Forum Members
Posts: 51, Visits: 376
I really like web sites that have search boxes with the grayed out text message that clears when clicked in. See attached images. It seems that this would be a great feature for the StrataFrame-wrapped controls like the textbox, combobox, etc., especially in BrowseDialogs. This would another little UI feature that would really help the product shine.



Thanks,

Derek
Attachments
Search_Before_Click.png (255 views, 2.00 KB)
Search_After_Click.png (293 views, 2.00 KB)
Replies
Bill Cunnien
Bill Cunnien
StrataFrame VIP (1.2K reputation)StrataFrame VIP (1.2K reputation)StrataFrame VIP (1.2K reputation)StrataFrame VIP (1.2K reputation)StrataFrame VIP (1.2K reputation)StrataFrame VIP (1.2K reputation)StrataFrame VIP (1.2K reputation)StrataFrame VIP (1.2K reputation)StrataFrame VIP (1.2K reputation)
Group: Forum Members
Posts: 785, Visits: 3.6K
If the textbox is to be bound, make sure to strip that InitialText value from the Text property before saving. There may be a way to overlay that initial text, too, rather than replace the Text property. Just thinking out loud. Les have given you a great start, though. Have fun!!
Greg McGuffey
Greg McGuffey
Strategic Support Team Member (4.8K reputation)
Group: Forum Members
Posts: 2K, Visits: 6.6K
I haven't tried this, so it might not work, but I'd actually look into overriding the OnPaint method. If there is Text set, just do default (base.OnPaint), otherwise render the InitialText. That way you wouldn't have to worry about handling accidentally saving the InitialText and you'd only have one method to override (rather than a set of events). I.e. this would more clearly separate the text that is initially shown vs. the Text that is bound.
Greg McGuffey
Greg McGuffey
Strategic Support Team Member (4.8K reputation)
Group: Forum Members
Posts: 2K, Visits: 6.6K
I couldn't help myself. I had to try the OnPaint method. It wasn't easy. I just posted my test project in the user samples area:



http://forum.strataframe.net/FindPost25587.aspx



It is kind of cool, but doesn't perform as well as I'd like. It is a good example of how to do this sort of thing (and maybe why not to do it), so you might want to check it out. This drawing stuff isn't easy.... Blink
GO

Merge Selected

Merge into selected topic...



Merge into merge target...



Merge into a specific topic ID...





Similar Topics

Reading This Topic

Login

Explore
Messages
Mentions
Search