我正在使用Material Design TimePicker
来输入一些时间。时间选择器工作正常。但我对这种风格有疑问。我想从显示的控件中删除提示文本"选择时间"默认情况下。
control = new MaterialDesignThemes.Wpf.TimePicker { Name = "timepicker_" + df.dataName, SelectedTime = null, HorizontalAlignment = HorizontalAlignment.Center, VerticalAlignment = VerticalAlignment.Center };
this.RegisterName("timepicker_" + df.dataName, control);
我想从时间pickermcontrol中删除此提示帮助文本。从代码背后。
答案 0 :(得分:2)
将HintAssist.Hint
附加属性设置为string.Empty
或null
:
control = new MaterialDesignThemes.Wpf.TimePicker { Name = "timepicker_" + df.dataName, SelectedTime = null, HorizontalAlignment = HorizontalAlignment.Center, VerticalAlignment = VerticalAlignment.Center };
MaterialDesignThemes.Wpf.HintAssist.SetHint(control, string.Empty);