2

I would like the same tool tip message (the one entered in the "ToolTip on myControlId" field) to be displayed when the mouse is hovered over an area which contains multiple controls. I tried putting the controls inside a Panel and GroupBox, but it only works when the mouse is in the "white space" area of the Panel/GroupBox, and, of course, does not work when the mouse is on a control within the Panel/GroupBox.

I'm from the web dev world so I'm open to suggestions for a new approach if I'm going about this the wrong way.

StronglyTyped
  • 2,134
  • 5
  • 28
  • 48
  • 1
    We have the same question. Ideally we want the same tooltip shown for all controls in our stackpanel. So we could put the tooltip on the stackpanel, and then put the exact same tooltip manually on all controls in the stack panel (either in the xaml or programmatically in the code behind), but then as the user moves the mouse from one control to another the tooltip constantly disappears and reappears, which is undesirable. One thought is to put a transparent control/image over the entire stackpanel and put the tooltip on that, but I haven't tested this yet; it might block input to the controls – deadlydog Jul 08 '13 at 17:02

1 Answers1

1

In standart windows developmern (WindowsForms) tootltip or tooltip control is associated to a single control. But you can use ToolTip control (see example how: ToolTip: Windows Forms .NET) and assign to all controls that recieve mouseover event.

If you're in WPF, the story becomes easier as you have message routing so usually it's enought to have subscription in one place.

Hope this helps.

Tigran
  • 61,654
  • 8
  • 86
  • 123
  • Thanks for the reply. I understand that you can assign the same ToolTip control to multiple controls, but you still need to set the message for each control you assign it to (as shown in the 3rd screenshot of that website - those are the properties for the button and not the ToolTip). – StronglyTyped Apr 20 '12 at 14:26
  • Sure you need do that. If you want centralize it, you can handle a mouseover over of all controls present in "group" and check: contol type (so pickup the right message), assign to tooltip and show – Tigran Apr 20 '12 at 14:32