瑞峰的博客

导航

2006年4月29日 #

如何在C#中使用 Win32和其他库 (转自天极网载)

摘要: 如何在C#中使用 Win32和其他库 2003-01-02· · ··Microsoft 这一次我们将深入探讨如何在 C# 中使用 Win32 和其他现有库。   C# 用户经常提出两个问题:“我为什么要另外编写代码来使用内置于 Windows 中的功能?在框架中为什么没有相应的内容可以为我完成这一任务?”当框架小组构建他们的 .NE... 阅读全文

posted @ 2006-04-29 18:34 峰子 阅读(421) 评论(0) 推荐(0)

C#WinFrom程序 打印,不显示取消对话框

摘要: C#打印,不显示取消对话框PrintDocument pd = new PrintDocument();//隐藏 取消对话框PrintController printController = new StandardPrintController();pd.PrintController = printController;//创建打印画布Graphics g = pd.PrinterSettin... 阅读全文

posted @ 2006-04-29 18:27 峰子 阅读(1480) 评论(1) 推荐(0)

C# 使用WIN32API获取打印机

摘要: C# 使用WIN32API获取打印机转来转去,又回到WIN32API上来了,无奈啊。。。。。。怪不得C++依然这么吃香 啊。。。。。.Net给我们提供了DllImport来操作非托管的DLL(发现C#如此的强啊~~~~暗自偷笑)。主要使用到winspool.drv中的EnumPrinters函数,代码如下:[DllImport("winspool.drv", SetLastError = true... 阅读全文

posted @ 2006-04-29 18:05 峰子 阅读(987) 评论(0) 推荐(0)

隐藏很讨厌的“取消”打印对话框,并通过异步回调,取得异步操作的返回结果

摘要: 隐藏很讨厌的“取消”打印对话框,并通过异步回调,取得异步操作的返回结果以打印为例:using System.Drawing.Printing;首先:声明委托 delegate void PrintInBackgroundDelegate();private TextPrintDocument printDoc = new TextPrintDocument();privat... 阅读全文

posted @ 2006-04-29 17:53 峰子 阅读(794) 评论(3) 推荐(0)