发布网友 发布时间:2022-04-26 23:31
共2个回答
热心网友 时间:2022-04-27 10:23
public class TextBoxEx : TextBox { static TextBoxEx() { DefaultStyleKeyProperty.OverrideMetadata(typeof(TextBoxEx), new FrameworkPropertyMetadata(typeof(TextBoxEx))); HelpTextProperty = DependencyProperty.Register("HelpText", typeof(string), typeof(TextBoxEx), new FrameworkPropertyMetadata("请您输入..", new PropertyChangedCallback(OnHelpTextChanged))); } public static DependencyProperty HelpTextProperty; public string HelpText { get { return (string)GetValue(HelpTextProperty); } set { SetValue(HelpTextProperty, value); } } private static void OnHelpTextChanged(DependencyObject sender, DependencyPropertyChangedEventArgs e) { } }追问你这个回答,对得起你的职业吗?
热心网友 时间:2022-04-27 11:41
重写控件的OnRender函数