Custom Print Dialog in c# .net 2.0

核能气质少年 提交于 2019-12-13 20:53:29

问题


I need to create a print dialog. However, on that print dialog, i just want to hide some printers. I have read some article about customprintdialog like:

http://www.abstraction.net/content/articles/windowsforms-customprintdialog.htm

However, i still cannot find out the way to get the list of printer on that print dialog. The dialog looks like:

Following the code in the link above, There is a GetDlgItem function from user32.dll library, that can help me to get a control from the dialog (Ok button's id is 1, Cancel button's id is 2):

private const int IDOK = 1;
private const int IDCANCEL = 2;

But i don't know the combobox's id (that contains list of printer) so i cannot edit that combobox. I have tried with some id like 3, 4.... but there is no item with these id.

Does anyone know how to customize the list of printer in this case, please help me :) If you have another solution for my problem that different with the one in my provied link, also let me know.

来源:https://stackoverflow.com/questions/22330261/custom-print-dialog-in-c-sharp-net-2-0

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!