Wednesday, January 12, 2005

Tooltips Redux

I had spoken a few days ago about tooltips in Web-UIs. They have one small shortcoming – you cannot control the visual appearance of the tooltip. The system default settings apply to your tooltip. There is (there usually always is!) a workaround. IE 5 had introduced a new technology called “behaviors”. In their simplest avatar, a behavior could be just a jscript file with the .htc extension. But there is more to behaviors, and I’d rather have you read about them here.

So why this digression from tooltips to behaviors? Well because there is a sample behavior that you can download from MSDN which gives you total control over appearance of your tooltips - they can contain HTML markup. This can come in especially handy when you are trying to show Indian scripts in a tooltip, which typically require slightly larger font for them to be legible. Here is an example (Thanks Vinod for supplying me with Tamizh translation!). More details about the tooltip behavior can be had from here.

Behaviors are close to 5 years old but can be used creatively with ASP.NET for creating some interesting UIs. (Hint: The IE Webcontrols use them internally). I’ll talk about an interesting use in one of my future posts shortly.

No comments: