Creating tooltips
Tooltips are typically those yellowish (or another color, depending on the Windows theme and user customization) pop ups that show up when the mouse pointer hovers over something important within the UI, providing some extra information relevant to that something. WPF makes it easy to create tooltips, either standard ones, or custom.
Getting ready
Make sure Visual Studio is up and running.
How to do it...
Create a new WPF application named
CH04.ToolTips
.Open
MainWindow.xaml
. Add two rows to the existingGrid
as follows:<Grid.RowDefinitions> <RowDefinition Height="Auto" /> <RowDefinition /> </Grid.RowDefinitions>
Add a
ToolBar
to theGrid
, with two buttons in it:<ToolBar> <Button Content="Copy" FontSize="16" Margin="4" Padding="4" Command="Copy" /> <Button Content="Paste" FontSize="16" Margin="4" Padding="4" Command="Paste" /> </ToolBar>
The
Command
properties used will make the buttons work...