|
|
|
@ -39,6 +39,7 @@ namespace formula_manage.Windows |
|
|
|
cbxPrinter.ItemsSource = this.GetLocalPrinters(); //打印机搜索
|
|
|
|
cbxPrinter2.ItemsSource = this.GetLocalPrinters(); |
|
|
|
cbxPrinter3.ItemsSource = this.GetLocalPrinters(); |
|
|
|
|
|
|
|
this.Closing += Window_Closing; //添加窗口关闭事件
|
|
|
|
} |
|
|
|
|
|
|
|
@ -55,6 +56,7 @@ namespace formula_manage.Windows |
|
|
|
|
|
|
|
private void Window_Print(object sender, RoutedEventArgs e) |
|
|
|
{ |
|
|
|
string Temp_M, Temp_S; |
|
|
|
UserClass.IniFile.IniFiles Configini = new UserClass.IniFile.IniFiles(INIPath); |
|
|
|
|
|
|
|
Printer = Boolean.Parse(Configini.IniReadvalue("PRINTER", "P1")); |
|
|
|
@ -65,8 +67,8 @@ namespace formula_manage.Windows |
|
|
|
cbxPrinter2.SelectedValue = Configini.IniReadvalue("PRINTER", "P8"); //读配置文件
|
|
|
|
cbxPrinter3.SelectedValue = Configini.IniReadvalue("PRINTER", "P9"); //读配置文件
|
|
|
|
Print_path2.Text = Configini.IniReadvalue("PRINTER", "P12"); |
|
|
|
Template_M.Text = Configini.IniReadvalue("PRINTER", "P13"); |
|
|
|
Template_S.Text = Configini.IniReadvalue("PRINTER", "P14"); |
|
|
|
Temp_M = Configini.IniReadvalue("PRINTER", "P13"); |
|
|
|
Temp_S = Configini.IniReadvalue("PRINTER", "P14"); |
|
|
|
|
|
|
|
TEXT_Print.IsChecked = Printer; |
|
|
|
cbxPrinter.IsEnabled = Printer; |
|
|
|
@ -78,13 +80,15 @@ namespace formula_manage.Windows |
|
|
|
cbxPrinter3.IsEnabled = Printer3; |
|
|
|
|
|
|
|
DirectoryInfo di_M = new DirectoryInfo(Print_path.Text); //new文件夹
|
|
|
|
FileInfo[] files_M = di_M.GetFiles();//加载文件夹中的文件名
|
|
|
|
Template_M.ItemsSource = files_M; |
|
|
|
FileInfo[] files_M = di_M.GetFiles();//生成文件夹中的文件名合集
|
|
|
|
Template_M.ItemsSource = files_M;//加载合集
|
|
|
|
Template_M.DisplayMemberPath = "Name"; // 显示文件名
|
|
|
|
DirectoryInfo di_S = new DirectoryInfo(Print_path2.Text); |
|
|
|
FileInfo[] files_S = di_M.GetFiles(); |
|
|
|
Template_S.ItemsSource = files_S; |
|
|
|
Template_S.DisplayMemberPath = "Name"; |
|
|
|
Template_M.Text = Temp_M;//传入保存的默认模板
|
|
|
|
Template_S.Text = Temp_S;//
|
|
|
|
} |
|
|
|
|
|
|
|
private void Window_Closing(object sender, System.ComponentModel.CancelEventArgs e) //窗口关闭事件
|
|
|
|
|