摘要:
If you select an item in a listbox it gets the default selection color (usually blue) as background. Even if you specify a custom data template. The reason is that the blue background (or gray if the control is not focussed) is drawn outside of the data template. So you have no chance to override it 阅读全文
摘要:
做过WinForm开发的都会郁闷WPF竟然没有Timer。今天想在WPF中用Timer可是发现WPF没有Timer类,找了半天发现新增了一个 DispatcherTimer确实好用和WinForm中Timer用法相似。-----------------------------------------------------------------------------------------------------------------------------引:银光中国在 WPF 中不再有类似 WinForm 中的 Timer 控件,因此,需要使用 DispatcherTimer 类来实 阅读全文
摘要:
1 <!--按钮样式--> 2 <Style TargetType="Button"> 3 <Setter Property="Foreground" Value="Black"/> 4 <!--修改模板属性--> 5 <Setter Property="Template"> 6 <Setter.Value> 7 <!--控件模板--> 8 <ControlTemplate TargetType="Button&qu 阅读全文
摘要:
KeyDown事件:2011-04-28优化Tab And RightCtrl private void tbCount_KeyDown(object sender, KeyEventArgs e) { TextBox txt = sender as TextBox; //屏蔽非法按键 if ((e.Key >= Key.NumPad0 && e.Key <= Key.NumPad9) || e.Key == Key.Decimal || e.Key.ToString() == "Tab") { if (txt.Text.Contains(&qu 阅读全文