views:

897

answers:

2

I'm extending the Aero glass frame into the client area and want to place a search box on the extended frame, just like it Windows Explorer does:

Windows Explorer Search Box

The default WPF text box has a grey/blue border though, and not the dark, white glowing border that can be seen on the screenshot. How do I change the WPF text box to use the same style as the Windows Explorer search box?

A: 

I doubt that there is a standard way of doing this in WPF. My best bet would be to style the control myself using Blend. This way you should be able to customize the look and feel of the textbox by specifying a different template for it. HTH.

Jonathan van de Veen
+5  A: 

This is my attempt to recreate the look of the Windows Explorer search box in WPF:

WPF solution compared to original

It doesn't look 100% like the original, but it's pretty close.

Here's the code:

<Border BorderBrush="#40FFFFFF" BorderThickness="1" CornerRadius="2">
  <Border BorderBrush="#80000000" BorderThickness="1,1,0,0" CornerRadius="2">
    <Border BorderBrush="#30000000" BorderThickness="0,0,1,1" CornerRadius="2">
      <Border BorderBrush="#F0FFFFFF" BorderThickness="1" CornerRadius="1">
        <TextBox Background="#C0FFFFFF" BorderThickness="0"></TextBox>
      </Border>
    </Border>
  </Border>
</Border>
dtb