Use blend to edit the template of the TextBox and modify the Listboxchrome in it to border.
1 <application.resources>2 <LinearGradientBrushx:key= "Textboxborder"EndPoint= "0,20"MappingMode= "Absolute"StartPoint= "0,0">3 <GradientStopColor= "#ABADB3"Offset= "0.05"/>4 <GradientStopColor= "#E2E3EA"Offset= "0.07"/>5 <GradientStopColor= "#E3E9EF"Offset= "1"/>6 </LinearGradientBrush>7 <Stylex:key= "Cornettextboxstyle"BasedOn="{x:null}"TargetType="{x:type TextBox}">8 <Setter Property= "Foreground"Value="{dynamicresource {x:static Systemcolors.controltextbrushkey}}"/>9 <Setter Property= "Background"Value="{dynamicresource {x:static Systemcolors.windowbrushkey}}"/>Ten <Setter Property= "BorderBrush"Value="{StaticResource Textboxborder}"/> One <Setter Property= "BorderThickness"Value= "1"/> A <Setter Property= "Padding"Value= "1"/> - <Setter Property= "AllowDrop"Value= "true"/> - <Setter Property= "FocusVisualStyle"Value="{x:null}"/> the <Setter Property= "Scrollviewer.panningmode"Value= "Verticalfirst"/> - <Setter Property= "stylus.isflicksenabled"Value= "False"/> - <Setter Property= "Template"> - <Setter.value> + <ControlTemplateTargetType="{x:type TextBox}"> - <Borderx:name= "Bd"BorderBrush="{TemplateBinding BorderBrush}"borderthickness="{TemplateBinding BorderThickness}"Background="{TemplateBinding Background}"Snapstodevicepixels= "true"Cornerradius= "5"> + <ScrollViewerx:name= "PART_ContentHost"Snapstodevicepixels="{TemplateBinding Snapstodevicepixels}"/> A </Border> at <controltemplate.triggers> - <Trigger Property= "IsEnabled"Value= "false"> - <Setter Property= "Background"TargetName= "Bd"Value="{dynamicresource {x:static Systemcolors.controlbrushkey}}"/> - <Setter Property= "Foreground"Value="{dynamicresource {x:static Systemcolors.graytextbrushkey}}"/> - </Trigger> - </controltemplate.triggers> in </ControlTemplate> - </Setter.value> to </Setter> + <style.triggers> - <MultiTrigger> the <multitrigger.conditions> * <Condition Property= "isinactiveselectionhighlightenabled"Value= "true"/> $ <Condition Property= "Isselectionactive"Value= "false"/>Panax Notoginseng </multitrigger.conditions> - <Setter Property= "Selectionbrush"Value="{dynamicresource {x:static Systemcolors.inactiveselectionhighlightbrushkey}}"/> the </MultiTrigger> + </style.triggers> A </Style> the <!--Resources scoped at the application level should is defined here. - + </application.resources>
[WPF] Round-the-corner textbox