My suggestion is that you replace each of the Textbox's
with a DockPanel
. In which they each have an Image
as the left-most item and a Textbox
as the right most. Then set the images to User and Lock respectively. Then set the backgrounds of the Textbox
and Images
to transparent. You can then set whatever styling you want on the DockPanel
.
EDIT 1 - Copy paste from working example
Code:
<DockPanel>
<Button BorderThickness="0" DockPanel.Dock="Left" HorizontalAlignment="Right" Height="28" Width="23">
<DynamicResource ResourceKey="SearchBar"/>
</Button> 'This is a button, because I have a custom Style which I am using which makes all the borders go away. And also because I use it to clear the field.
<TextBox Text="Search..." FontSize="16" HorizontalAlignment="Stretch" Background="Transparent"/>
</DockPanel>
Image:
By not setting the DockPanel.Dock
property on the second item, I am telling it to stretch across the rest of the DockPanel
. Any other queries, please let me know. If you copy paste the above, it might not look the same, due to me cutting out irrelevant parts.