Note that there are some explanatory texts on larger screens.

plurals
  1. POChanging text of Textbox, when IsFocused=false
    primarykey
    data
    text
    <p>How can I make following functionality:</p> <p>if Textbox is not focused, and user didn't type any text there, textbox should have default value, something like <em>Enter Name Here...</em>. If user click on that textbox this label should dissapear.</p> <p>Appreciate any help.</p> <p>This is what I have so far. But this is control template. I think it's not so helpfull in this question but anyway.</p> <pre><code> &lt;ControlTemplate x:Key="TextBoxBaseControlTemplate" TargetType="{x:Type TextBoxBase}"&gt; &lt;Border Background="{TemplateBinding Background}" x:Name="Bd" BorderBrush="LightGray" BorderThickness="{TemplateBinding BorderThickness}" CornerRadius="10"&gt; &lt;Grid VerticalAlignment="Center"&gt; &lt;ScrollViewer Margin="5 0 0 0" HorizontalScrollBarVisibility="Disabled" VerticalScrollBarVisibility="Disabled" x:Name="PART_ContentHost"/&gt; &lt;/Grid&gt; &lt;/Border&gt; &lt;ControlTemplate.Triggers&gt; &lt;Trigger Property="IsEnabled" Value="False"&gt; &lt;Setter Property="Background" Value="{DynamicResource {x:Static SystemColors.ControlBrushKey}}" TargetName="Bd"/&gt; &lt;Setter Property="Foreground" Value="{DynamicResource {x:Static SystemColors.GrayTextBrushKey}}"/&gt; &lt;/Trigger&gt; &lt;Trigger Property="Width" Value="Auto"&gt; &lt;Setter Property="MinWidth" Value="100"/&gt; &lt;/Trigger&gt; &lt;Trigger Property="Height" Value="Auto"&gt; &lt;Setter Property="MinHeight" Value="20"/&gt; &lt;/Trigger&gt; &lt;/ControlTemplate.Triggers&gt; &lt;/ControlTemplate&gt; </code></pre>
    singulars
    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.
 

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