我用下面的代碼創建了自定義ctextbox。但我無法爲此提供圓角邊框。如何在WPF中爲自定義TextBox控件指定CornerRadius?
public class FilteredTextBox : TextBox
{
public FilteredTextBox()
: base()
{
IsNumeric = false;
IsRegex = false;
IsRequired = false;
ErrorMsg = "";
RegexText = "";
HorizontalAlignment = HorizontalAlignment.Stretch;
Margin = new Thickness(0);
BorderThickness = new Thickness(1);
var border = new Border {CornerRadius = new CornerRadius(4)};
}
}
請指導我這個嗎?