views:

34

answers:

2

currently I am using a tool tip to display information when it hovers over a region on a winform. This works well and I don't have any complaints, but the boss want's to display more complex data, that would best be displayed in a grid rather than text. Is there a way that perhaps I could embed a usercontrol or a datagridview in a tool tip.

thanks

C#, .Net 2.0, windows.Forms

A: 

You can write a custom control (shouldn't be too hard, just a yellow rectangle with a drop shadow) with a data grid on it. It just needs to fade out when the mouse moves away and get displayed after the mouse rests on it for a couple of seconds.

Maz
+2  A: 

There's such a thing as an owner-drawn tooltip. You'd have to handle the painting of the grid yourself. You wouldn't get any interactivity, although a tooltip that lets you click and scroll sounds odd anyway.

If your boss is willing to spend money on this then I can happily recommend the DevExpress tooltip control, for its customisability.

Tim Robinson
There will be no interaction. But he want's to have the information displayed in rows and columns and the strings are a variety of lengths...I didn't want to mess with a bunch of tabs in order to achieve the effect
fishhead
Sure - I'd imagine it would be straightforward to turn on owner drawing, and draw the grid into the tooltip on request.
Tim Robinson