views:

569

answers:

1

I have a ComboBox with a DataTemplate. The DataTemplate has two controls, each of which has a ToolTip attached to it. The list of items of the ComboBox has the tooltips as expected when you hover over each control. But the selected item area on top of the ComboBox does not display the tooltips, though the controls are rendered as expected. Is there a way to force the tooltips to be displayed?

A: 

If you're using Mole or something similar, make sure that your control with the attached ToolTIp has IsHitTestVisible="True". Otherwise, the control is not listening for mouse events and will not recognize that the ToolTip should be shown in the first place.

You may also want to look at binding the ToolTip of the selected item to the ContentPresenter in the ComboBox since, after selection, your SelectedItem becomes the content of the ComboBox. You may need to override the ComboBox template and make sure the ContentPresenter can accept mouse input in order to force your ToolTip's visibility.

Jeff Wain
No, I'm not using anything like that. Is there any way to bind to the contentpresenter without making a new template? I considered templates, but they always seem to be a mass of copy-paste from Blend, and don't change themes accordingly.
Jamie
In that case, the easiest way would be to manually set the ToolTip on the ComboBox itself when the SelectionChanged event fires.
Jeff Wain