1- Copy and paste the following code into MainWindow.xaml file.
<Window x:Class="WpfApplication1.MainWindow"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
Title="MainWindow" Height="350" Width="525">
<Grid>
<TextBox x:Name="TextBox1" Height="25" Width="200" Background="Yellow" MouseEnter="TextBox1_MouseEnter" MouseLeave="TextBox1_MouseLeave"/>
<Popup x:Name="Popup1" IsOpen="False" StaysOpen="True" AllowsTransparency="True" PlacementTarget="{Binding ElementName=TextBox1}" Placement="Bottom">
<Label Background="Yellow" Content="Hi stackoverflow"/>
</Popup>
</Grid>
</Window>
2- Copy and paste the following code into MainWindow.xaml.cs file.
namespace WpfApplication1
{
public partial class MainWindow : Window
{
public MainWindow()
{
InitializeComponent();
}
private void TextBox1_MouseEnter(object sender, MouseEventArgs e)
{
Popup1.IsOpen = true;
}
private void TextBox1_MouseLeave(object sender, MouseEventArgs e)
{
Popup1.IsOpen = false;
}
}
}
3- You will see that Popup1 opens properly when you put your mouse on TextBox1.
My question is here;
I dont want Popup1 opens as soon as you put your mouse on TextBox1.
In other words I want Popup1 opens if User put his mouse on TextBox1 at least one second.
You know that ToolTip doesnt open as soon as you put your mouse.
So I want ToolTip behavior for Popup1.