随笔分类 -  silverlight

摘要:有一个需求,在弹出的页面里,用户没有进行某个操作时,不允许退出弹出页面。项目是silverlight做的。弹出页面是个silverlight子窗口。vs会自动在页面右上角有个X按钮。先上一段开始写的屏蔽右上角关闭按钮的代码,为页面添加closing事件。 1 //关闭窗体 2 private void ChildWindow_Closing(object sender, System.ComponentModel.CancelEventArgs e) 3 { 4 //判断自己的关闭按钮是否可用 5 if (btnCl... 阅读全文
posted @ 2012-11-20 10:59 Bonker 阅读(3587) 评论(4) 推荐(2) 编辑
摘要:打印辅助类。首先添加using System.Windows.Printing;命名空间 1 public class SilverPrint 2 { 3 //设置每一项之间的间距 4 int listPrintIndex = 0; 5 private List<PrintStr> listStr = null; 6 public void Print(List<PrintStr> strs) 7 { 8 listStr = strs; 9 PrintDocu... 阅读全文
posted @ 2012-11-06 12:58 Bonker 阅读(1273) 评论(0) 推荐(0) 编辑
摘要:转载地址http://www.cnblogs.com/lanbaoming/archive/2011/07/21/2112353.html 1 publicpartialclass Timer : UserControl 2 { 3 public Timer() 4 { 5 // 为初始化变量所必需 6 InitializeComponent(); 7 DispatcherTimer timer =new DispatcherTimer(); 8 timer.Interval =new TimeSp... 阅读全文
posted @ 2012-11-05 17:03 Bonker 阅读(166) 评论(0) 推荐(0) 编辑
摘要:1,如果项目允许在浏览器外运行 this.Loaded += (object sender, RoutedEventArgs e) =>{ this.txtMoney.Focus();//用户名文本聚焦 };2,项目为浏览器运行 this.Loaded += (object sender, RoutedEventArgs e) => { HtmlPage.Plugin.Focus();//silverlight插件聚焦 this.txtMoney.Focus();//用户名文本聚焦 };3,不确定什么方式运行 ... 阅读全文
posted @ 2012-03-20 15:02 Bonker 阅读(867) 评论(0) 推荐(0) 编辑