开发环境:
Windows7 x64 旗舰版
vs2008 32位
bug如下:
新建一个窗体,里面一个按钮 《弹框》,一个printDocument1控件
《弹框的代码》:
PrintDialog printDialog1 = new PrintDialog();
printDialog1.Document = this.printDocument1;
if (printDialog1.ShowDialog() == DialogResult.OK)
{
printDocument1.DefaultPageSettings.Landscape = true;
this.printDocument1.Print();
}
弹不出来打印提示框!!!!!!!!!!!!!!!!!!!!!
第二:如果从工具箱中拉一个printDialog1控件到窗体上
《弹框》代码如下:
//PrintDialog printDialog1 = new PrintDialog();
//printDialog1.Document = this.printDocument1;
if (printDialog1.ShowDialog() == DialogResult.OK)
{
printDocument1.DefaultPageSettings.Landscape = true;
this.printDocument1.Print();
}
则可以弹出打印提示框!!!!!!!!!!!!!!!!!
求解:为什么自己实例化的打印对话框不能弹出,而拉过来的控件则可以呢?
这两段代码在vs2010上都能弹出打印提示框,但是提示框的样子都不一样!!!!!!!!
求解!
------解决方案--------------------------------------------------------
界面都不一样


------解决方案--------------------------------------------------------
可以弹出打印框的啊,
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Windows.Forms;
namespace WindowsFormsApplication2
{
public partial class Form1 : Form
{
public Form1()
{
InitializeComponent();
}
private void Form1_Load(object sender, EventArgs e)
{