打印模板选择修改
This commit is contained in:
commit
1754131d54
2 files changed
+9
-5
No files matched your search
+1
-1
@@ -11,7 +11,7 @@
|
||||
<TextBox x:Name="Print_path" HorizontalAlignment="Left" Height="20" Margin="90,35,0,0" VerticalAlignment="Top" Width="285" MaxLines="1" IsReadOnly="True"/>
|
||||
<Button Content="浏览路径" HorizontalAlignment="Left" Height="20" Margin="375,35,0,0" VerticalAlignment="Top" Width="70" Background="#FFF9F9F9" Click="Button_Click"/>
|
||||
<TextBlock HorizontalAlignment="Left" Height="15" Margin="20,70,0,0" TextWrapping="Wrap" Text="默认打印模板:" VerticalAlignment="Top" Width="90"/>
|
||||
<ComboBox Text="12" HorizontalAlignment="Left" Height="20" Margin="110,65,0,0" VerticalAlignment="Top" Width="180" x:Name="Template_M"/>
|
||||
<ComboBox HorizontalAlignment="Left" Height="20" Margin="110,65,0,0" VerticalAlignment="Top" Width="180" x:Name="Template_M"/>
|
||||
<CheckBox HorizontalAlignment="Left" Height="15" Margin="20,95,0,0" Content="默认打印机:" VerticalAlignment="Top" Width="90"
|
||||
x:Name="TEXT_Print" Checked="Print_Checked" Unchecked="Print_Checked"/>
|
||||
<ComboBox HorizontalAlignment="Left" Height="20" Margin="110,90,0,0" VerticalAlignment="Top" Width="180"
|
||||
|
||||
@@ -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) //窗口关闭事件
|
||||
|
||||
Reference in new issue
Block a user