XAML equivalent of the HTML head attribute

I am developing a small C # WPF application and I would like to know if there is any equivalent of the html title attribute in the xaml so that when the mouse hovers over a button or element it displays a short text to help the user know what he is doing this button?

If it doesn't exist, how do you implement it?

+3


source to share


1 answer


The clues do exist. Below is an example of a complex prompt.

<TextBox HorizontalAlignment="Left">TextBox with ToolTip
  <TextBox.ToolTip>
    <TextBlock>Useful information goes here.</TextBlock>
  </TextBox.ToolTip>
</TextBox>

      

Taken from ToolTip Class .



A simple text prompt can be done like this:

<TextBox HorizontalAlignment="Left" 
         ToolTip="Useful information goes here.">TextBox with ToolTip</TextBox>

      

This should work for almost any WPF control.

+5


source







All Articles