EExcel 丞燕快速查詢2

EExcel 丞燕快速查詢2
EExcel 丞燕快速查詢2 https://sandk.ffbizs.com/

c# not vb.net PrintPreviewDialog PrintDialog 在PreviewDialog中按列印鈕,直接呼叫PrintDialog

http://www.blueshop.com.tw/board/FUM20050124191756KKC/BRD200707131926393KJ.html
http://homepage1.nifty.com/yamato/texts/memorandum/memo5_1.html



Globa
private ToolStripButton tbs = new ToolStripButton();


private void preview_Click(object sender, EventArgs e)  //normal buttion click
{
  tbs.Text = "Print";
  tbs.Click += new EventHandler(tbs_Click);

  PrintPreviewDialog print_preview = new PrintPreviewDialog();
  ((ToolStripButton)((ToolStrip)print_preview.Controls[1]).Items[0]).Visible = false;
  ((ToolStrip)print_preview.Controls[1]).Items.Insert(0, tbs);

  print_preview.Document = printDocument1;  //PrintPreviewDialog
  print_preview.ShowDialog();
}

private void tbs_Click(object sender, EventArgs e) {
  MessageBox.Show("dd");  //now here can put PrintDialog code

  var print_dialog = new PrintDialog();
  print_dialog.Document = printDocument1;

  if (print_dialog.ShowDialog() == DialogResult.OK)
  {
      printDocument1.Print();
  }
}