Welcome to OGeek Q&A Community for programmer and developer-Open, Learning and Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
310 views
in Technique[技术] by (71.8m points)

c# - 如何从WebBrowser.ShowPageSetupDialog获取对话框结果(How to get dialog result from WebBrowser.ShowPageSetupDialog)

I'm using a WebBrowser control in my Visual C# (.net 2.0) application.

(我在Visual C#(.net 2.0)应用程序中使用了WebBrowser控件。)
Now I'd like to add a print button which shows the page setup dialog and then directly prints when the user presses the OK button or cancels the printing when the user presses the cancel button.

(现在,我想添加一个显示页面设置对话框的打印按钮,然后在用户按下“确定”按钮时直接打印,或者在用户按下“取消”按钮时取消打印。)
However WebBrowser.ShowPageSetupDialog doesn't return DialogResult, but just void.

(但是,WebBrowser.ShowPageSetupDialog不会返回DialogResult,而只是返回void。)
Is there something I've missed or any other way to know the users action?

(是否有我想念的东西或了解用户操作的其他方法?)

  ask by Marc translate from so

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome To Ask or Share your Answers For Others

1 Reply

0 votes
by (71.8m points)

The page setup dialog box off a WebBrowser control sets registry entries.

(WebBrowser控件之外的页面设置对话框设置注册表项。)

What I've done in the past was to set those values for the user in code and only gave them the option to print.

(我过去所做的就是在代码中为用户设置这些值,而只给他们打印选项。)


与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
OGeek|极客中国-欢迎来到极客的世界,一个免费开放的程序员编程交流平台!开放,进步,分享!让技术改变生活,让极客改变未来! Welcome to OGeek Q&A Community for programmer and developer-Open, Learning and Share
Click Here to Ask a Question

1.4m articles

1.4m replys

5 comments

57.0k users

...