博客园  :: 首页  :: 新随笔  :: 联系 :: 订阅 订阅  :: 管理

2012年7月23日

摘要: 按分类汇总一下WPF的控件:按钮(Buttons): Button, RepeatButton对话框(Dialog Boxes):打开文件对话框OpenFileDialog, 打印对话框PrintDialog, 文件保存对话框SaveFileDialog数字化墨水(Digital Ink): 墨水面板InkCanvas,墨迹呈现器InkPresenter文档(Documents): DocumentViewer, FlowDocumentPageViewer, FlowDocumentReader, FlowDocumentScrollViewer,StickyNoteControl输入框(I 阅读全文

posted @ 2012-07-23 23:54 linFen 阅读(1311) 评论(0) 推荐(0) 编辑

摘要: C#代码: string printFileName = @"C:/TestForPrint.xps"; public void InvokePrint(object sender, RoutedEventArgs e) { //打印对话框,设置属性 PrintDialog pDialog = new PrintDialog(); pDialog.PageRangeSelection = PageRangeSelection.AllPages; pDialog.UserPageRangeEnabled = true; // 这里你还可以设置对话框的MaxPage,MinPa 阅读全文

posted @ 2012-07-23 23:53 linFen 阅读(1147) 评论(0) 推荐(0) 编辑

摘要: WPF本身并没有为我们提供文件浏览的控件, 也不能直接使用Forms中的控件,而文件浏览对话框又是我们最常用的控件之一. 下面是我实现的方式方式1: 使用win32控件OpenFileDialog?1234567Microsoft.Win32.OpenFileDialog ofd = new Microsoft.Win32.OpenFileDialog(); ofd.DefaultExt = ".xml"; ofd.Filter = "xml file|*.xml"; if (ofd.ShowDialog() == true) { //此处做你想做的事 阅读全文

posted @ 2012-07-23 23:52 linFen 阅读(38647) 评论(2) 推荐(2) 编辑

摘要: 在WPF中,系统定义的对话框(Dialog)有三种:(1)Microsoft.Win32.OpenFileDialog(2)Microsoft.Win32.SaveFileDialog(3)System.Windows.Controls.PrintDialog先看看前面两种的层次继承关系:System.Object Microsoft.Win32.CommonDialog Microsoft.Win32.FileDialog Microsoft.Win32.OpenFileDialog Microsoft.Win32.SaveFileDialog我们看到,这两种对话框均位于Microsoft. 阅读全文

posted @ 2012-07-23 23:51 linFen 阅读(6584) 评论(0) 推荐(0) 编辑