我正在尝试制作一个带有嵌入式放大镜图标的搜索文本框。到目前为止,我已经编写了以下标记:
<Border DockPanel.Dock="Bottom" Margin="2,4,0,4"
BorderThickness="1" SnapsToDevicePixels="True"
BorderBrush="{DynamicResource {x:Static SystemColors.ControlDarkBrushKey}}">
<DockPanel>
<StackPanel Orientation="Horizontal" DockPanel.Dock="Right">
<Image Source="/Resources/search-13x13.png" Width="13"/>
</StackPanel>
<TextBox Name="searchTextBox" DockPanel.Dock="Bottom" BorderThickness="0"
Text="{Binding FilterText, UpdateSourceTrigger=PropertyChanged}"/>
</DockPanel>
</Border>
然而,我在SystemColors中找不到与标准TextBox边框相同的颜色。默认情况下,这是一种蓝色。我是否非常愚蠢?!
编辑:顺便说一句,图像包含在一个stackpanel中,因为我计划在那里放置一个下拉箭头。