Open the MainWindow.xaml page, and then follow these steps to add simple tooltips to the UI:
- First, replace the default Grid with a StackPanel, and set its Orientation property to Horizontal to have some horizontally stacked items.
- Add three buttons to the StackPanel, and set their ToolTip property. To add a show duration of the tooltip, set its ToolTipService.ShowDuration attached property to a value in milliseconds. You can use the following XAML as a reference:
<StackPanel Orientation="Horizontal" HorizontalAlignment="Center" Margin="20"> <Button Content="New" Width="60" Height="30" ToolTip="Create a New file" Margin="4" /> <Button Content="Open" Width="60" Height="30" ToolTip="Open a file" ToolTipService.ShowDuration="2000" ...