Note that there are some explanatory texts on larger screens.

plurals
  1. POWPF TextBox Validating results ToolTip
    primarykey
    data
    text
    <p>Experimenting with WPF validating input, I tried to use ToolTip for displaying results of TextBox input validation, like this:</p> <pre><code>&lt;Style.Triggers&gt; &lt;Trigger Property="Validation.HasError" Value="true"&gt; &lt;Setter Property="ToolTip" Value="{Binding RelativeSource={RelativeSource Self}, Path=(Validation.Errors)[0].ErrorContent}"/&gt; &lt;/Trigger&gt; &lt;/Style.Triggers&gt; </code></pre> <p>It seemed for me very inconvenient, that ToolTip is shown not in the process of typing text in the Textbox, at the moment when validating error occurs, but only after mousepointer put intentionally over the TextBox. </p> <p>This seems violating user expectation regarding usability of UI, so I prefered putting the Validation Error results in a separate TextBlock, automatically and instantly appearing at the moment, when input validation error occurs.</p> <p>But maybe I'm wrong and don't use ToolTip properly? Maybe there are settings of ToolTip properties making ToolTip able appearing without intentional mousehover over TextBox?</p> <p><strong>Edited (added):</strong></p> <p>Using ToolTip for displaying results of TextBox input validation I have found in Microsoft MSDN documentation:</p> <p><a href="http://msdn.microsoft.com/en-us/library/ms752347.aspx#data_validation" rel="noreferrer">http://msdn.microsoft.com/en-us/library/ms752347.aspx#data_validation</a></p> <p><strong>Do you use ToolTips for showing validation errors? If so, how you get along with the fact that user can never see it (if he/she doesn't guess to hover a mouse over a textbox)?</strong> </p>
    singulars
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload