摘要: wpf控件的MouseEnter事件中设置5秒后隐藏控件 System.Timers.Timer timer = new System.Timers.Timer(5 * 1000);//5秒 timer.Elapsed += new System.Timers.ElapsedEventHandler 阅读全文
posted @ 2022-11-23 14:07 户的博客 阅读(285) 评论(0) 推荐(0) 编辑
摘要: 转载:调用线程无法访问此对象,因为另一个线程拥有该对象。 wpf控件MouseEnter绑定了事件,用Timer设置一段时间后执行时报异常 解决方法: this.Dispatcher.Invoke((Action)delegate () { //实现 }); 或 App.Current.Dispat 阅读全文
posted @ 2022-11-23 13:55 户的博客 阅读(1002) 评论(0) 推荐(0) 编辑
摘要: 16进制、rgb格式、提供的颜色示例: xxx.Foreground = new SolidColorBrush((Color)ColorConverter.ConvertFromString("#FFFFFF")); xxx.Background = new SolidColorBrush(Col 阅读全文
posted @ 2022-11-23 11:47 户的博客 阅读(1021) 评论(0) 推荐(0) 编辑
摘要: 音乐播放列表,鼠标右键点击列表时,出现添加到歌单,做成每次右键点击时,后台新增选项了(也可以前台绑定数据源每次增删改后更新数据源) TextBlock text = new TextBlock(); text.Text = "添加到歌单-" + list.Name; text.MouseDown + 阅读全文
posted @ 2022-11-23 11:46 户的博客 阅读(196) 评论(0) 推荐(0) 编辑
摘要: 参考:http://www.360doc.com/content/17/1113/11/24811_703389993.shtml // 1)子页面后台定义委托 (namespace下class外) //定义委托 internal delegate void ColorChange(object s 阅读全文
posted @ 2022-11-23 11:45 户的博客 阅读(662) 评论(0) 推荐(0) 编辑