Two quick WPF tricks: Show tooltip on disabled control and accessibility for WPF button
Question: When my control is disabled, it does not show any toolip, in spite of the fact, that it has one. What to do?
Answer: Use ToolTipService.ShowOnDisabled=”True” attached property
Question: You wrote grate article about accessibility of WPF. How to use it with QTP/WinRunner (or any other visual test programs). However it works on lists and other items controls, but not on content controls. What to do?
Answer: It works as well. More, then this. It works also without “style” hack” in .NET 3.5. See yourself
Here the source code
<StackPanel Orientation=”Vertical” DataContext=”{StaticResource datas}”>
<ListBox ItemsSource=”{Binding}” ItemTemplate=”{StaticResource t1}” ItemContainerStyle=’{StaticResource stl}’ IsSynchronizedWithCurrentItem=’True’/>
<Button Content=”{Binding Path=Prop2}” ToolTip=”{Binding RelativeSource={x:Static RelativeSource.Self}, Path=Content}”/>
<Button Content=”{Binding Path=Prop2}” ToolTipService.ShowOnDisabled=”True” IsEnabled=”False” ToolTip=”{Binding RelativeSource={x:Static RelativeSource.Self}, Path=Content}”/>
</StackPanel>
It works. If you’re using 3.0 just set AutomationProperties.Name property by using setters in style as described in the article and this will work for you.
<Style x:Key=”stl”>
<Setter Property=”AutomationProperties.Name” Value=”{Binding Prop2}”/>
</Style>
Have a nice day
April 13th, 2008 · Comments (3)
3 Responses to “Two quick WPF tricks: Show tooltip on disabled control and accessibility for WPF button”
Leave a Reply
Discover other tags
My tools
- .NET Framework Detector
- Duplicate images finder
- Exchange Security Policy for Windows Mobile Devices Fix
- Gas Price Windows Vista SideBar gadget
- Israel Traffic Information Windows Vista SideBar gadget
- Localization fix for SAP ES Explorer for Visual Studio
- LocTester
- RTL and LTR in Windows Live Writer
- Silverlight controls library
- Snipping tool integration plugin for WLW
- USB FM receiver library
- Vista Battery Saver
- WebCam control for WPF
- Windows Live SkyDrive attachment for Windows Live Writer
- Wireless Migrator
- WPF Virtual Keyboard




January 1st, 2009 at 12:44 am
I thought i found the answer to my problem alas the language the tooltip code is written in must be vb6 or some other ancient lingo thanks anyway
January 1st, 2009 at 12:44 am
QTP and WPF
April 26th, 2010 at 1:41 am
Great.. Tip #1 helped me a lot.