title: Putting icon in a textbox in XAML (WPF)
body: <p>I want to put a small icon (a png file) in to the corner of a textbox. A sketch of what I mean is at <a href="http://dosketch.com/view.php?k=mIPeHLSBLx0e2YpoVpYO" rel="nofollow">http://dosketch.com/view.php?k=mIPeHLSBLx0e2YpoVpYO</a></p>
  
  <p>So far I've got (in my main xaml file)</p>
  
  <pre><code>&lt;TextBox Style="{StaticResource IconTextBox"} ...
  </code></pre>
  
  <p>and in my resources area:</p>
  
  <pre><code>&lt;Style x:Key="IconTextBox" TargetType="TextBox"&gt;
   &lt;Setter Property="Template"&gt;
    &lt;Setter.Value&gt;
     &lt;ControlTemplate TargetType="TextBox"&gt;
       &lt;Image Source="icon.png" /&gt;
     &lt;/ControlTemplate&gt;
    &lt;/Setter.Value&gt;
   &lt;/Setter&gt;
  &lt;/Style&gt;
  </code></pre>
  
  <p>Obviously this isn't working (I'm losing the textbox for a start!). Ideally when the user is typing into the textbox, the text doesn't overlap the image - but for the time being I'll just be happy getting the image in the textbox.</p>
  
  <p>Thanks</p>