我有自定义控件与打印工具栏项.当打印控件对话框没有进入Windows 7与64位操作系统在其他系统操作系统工作正常.仅在具有64位的Windows 7中出现问题.
我的问题printdialog没有进入64位的Windows 7操作系统.
我已检查并分析 - > PrintDialog.ShowDialog()返回immeaditely取消instaed显示该问题的对话框.
我通过搜索以下链接找到了问题的解决方案:
http://social.msdn.microsoft.com/Forums/en/netfx64bit/thread/8760fb6c-ae63-444e-9606-cd3295ce6b5d
http://msdn.microsoft.com/en-us/library/system.windows.forms.printdialog.useexdialog.aspx
通过将true设置为printdialog的UseExDialog属性,对话框出现并且工作正常.但是这个对话框样式就像Windows XP而不是windows7样式.所以这不是解决方案.
UseExDialog属性设置为true表示工作正常.但打印对话框样式看起来像Windows XP打印不像Windows 7.我需要一些其他解决方案在Windows 7 os 64位显示打印对话框.
请为此问题提供完整的解决方案
谢谢
湿婆
我正在尝试MSDN使用PrintDocument打印的例子,但它并不是那么顺利.我已经完成了所有编译,但是当我点击打印时,会弹出"传真发送设置"窗口.这应该发生吗?我想打印,而不是发传真!
我需要更改什么才能直接打印到默认打印机?
谢谢!
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows.Forms;
using System.IO;
using System.Drawing.Printing;
namespace WindowsFormsApplication1
{
public partial class Form4 : System.Windows.Forms.Form
{
private System.ComponentModel.Container components;
private System.Windows.Forms.Button printButton;
private Font printFont;
private StreamReader streamToPrint;
public Form4()
{
// The Windows Forms Designer requires the following call.
InitializeComponent();
}
// The Click event is raised when the user clicks the Print button.
private void printButton_Click(object sender, EventArgs e) …Run Code Online (Sandbox Code Playgroud)