.NET 6, WPF: the ToolTip doesn't work on ComboBoxItem

Morariu Ernest 1 Reputation point
2022-01-27T01:56:12.173+00:00

Hi,

In .NET 6, the tooltip of the ComboBoxItem doesn't work if the ComboBox is inside of a UserControl.
It shows up for about 500ms and then it disappears.
Setting explicitly the 'ToolTipService.ShowDuration' doesn't help.
You can find below the xaml for the UserControl and for the Window. The root namespace(the project name) is "ToolTipTest".
Can somebody help me out?

Visual Studio Professional 2022 64-bit 17.0.5, .NET 6.0.1, Windows 10 Pro Version:21H1

<!--  The UserControl -->
<UserControl x:Class="TooTipTest.SomeUserControl"
             xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
             xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
             xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006" 
             xmlns:d="http://schemas.microsoft.com/expression/blend/2008" 
             xmlns:local="clr-namespace:TooTipTest"
             mc:Ignorable="d" 
             d:DesignHeight="50" d:DesignWidth="400">
    <Grid>
        <ComboBox>
            <ComboBoxItem Content="AAAA" ToolTip="aaaaaaa"/>
            <ComboBoxItem Content="BBBB" ToolTip="bbbbbbb"/>
            <ComboBoxItem Content="CCCC" ToolTip="ccccccc"/>
        </ComboBox>
    </Grid>
</UserControl>

<!-- Window Container-->
<Window x:Class="TooTipTest.MainWindow"
        xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
        xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
        xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
        xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
        xmlns:local="clr-namespace:TooTipTest"
        mc:Ignorable="d"
        Title="MainWindow" Height="350" Width="600">
    <Grid>

        <TextBlock Text="The TooTip on ComboBoxItem doesn't work; it shows up for only 500 ms." HorizontalAlignment="Center" VerticalAlignment="Center" Margin="0,0,0,50"/>
        <local:SomeUserControl VerticalAlignment="Center" HorizontalAlignment="Center" MinWidth="200"/>
    </Grid>
</Window>
Windows Presentation Foundation
Windows Presentation Foundation
A part of the .NET Framework that provides a unified programming model for building line-of-business desktop applications on Windows.
2,671 questions
{count} votes