Beispiel #1
0
 private void 直接打全部F2ToolStripMenuItem_Click(object sender, EventArgs e)
 {
     if (this.IsChecked())
     {
         int            i       = this.dataGridView1.SelectedRows[0].Index;
         VehicleInfo    vehicle = this.pager.Lists[i] as VehicleInfo;
         F2ExcelPrinter printer = new F2ExcelPrinter(vehicle);
         printer.PaintPrinter();
     }
 }
Beispiel #2
0
 void dataGridView1_KeyDown(object sender, KeyEventArgs e)
 {
     if (this.dataGridView1.SelectedRows.Count > 0)
     {
         int                    i       = this.dataGridView1.SelectedRows[0].Index;
         VehicleInfo            vehicle = this.pager.Lists[i] as VehicleInfo;
         BaseVehicleInfoPrinter printer = null;
         if (e.KeyCode == Keys.F1)
         {
             printer = new F1Printer(vehicle);
         }
         else if (e.KeyCode == Keys.F2)
         {
             printer = new F2ExcelPrinter(vehicle);
             printer.PaintPrinter();
             return;
         }
         else if (e.KeyCode == Keys.F3)
         {
             printer = new F3Printer(vehicle);
         }
         else if (e.KeyCode == Keys.F4)
         {
             printer = new F4Printer(vehicle);
         }
         else if (e.KeyCode == Keys.F5)
         {
             printer = new F5Printer(vehicle);
             //printer = new F5Printer(this.student);
         }
         else if (e.KeyCode == Keys.F6)
         {
             printer = new F6ExcelPrinter(vehicle);
             printer.PaintPrinter();
             return;
         }
         else if (e.KeyCode == Keys.F7)
         {
             printer = new F7ExcelPrinter(vehicle);
             printer.PaintPrinter();
             return;
         }
         if (printer != null)
         {
             this.Print(printer);
             //commonPrinter.ShowPreviewPrinter();
         }
     }
     //throw new Exception("The method or operation is not implemented.");
 }