简体   繁体   English

如何使用c#WPF在chm文件中打开特定页面

[英]How to open a particular page in chm file using c# WPF

I want to Open the particular page of CHM file. 我想打开CHM文件的特定页面。 I am using WPF application. 我正在使用WPF应用程序。 Currently i have implemented the 目前我已经实施了

System.Diagnostics.Process.Start(filepath)

This will not help open the particular page 这无助于打开特定页面

Regards, NewDev 此致,NewDev

It sounds like you're essentially trying to add context-sensitive help to a WPF application. 听起来您实际上是在尝试向WPF应用程序添加上下文相关帮助。 For example, that if you hit F1 with your cursor in a specific textbox, you'll see help for that specific textbox. 例如,如果您使用光标在特定文本框中点击F1,则会看到该特定文本框的帮助。

If that's the case, see this article: 如果是这种情况,请参阅此文章:

http://blogs.msdn.com/b/mikehillberg/archive/2007/07/26/a-context-sensitive-help-provider-in-wpf.aspx http://blogs.msdn.com/b/mikehillberg/archive/2007/07/26/a-context-sensitive-help-provider-in-wpf.aspx

or this one: 或者这个:

http://www.netframeworkdev.com/windows-presentation-foundation-wpf/contextsensitive-help-in-wpf-73953.shtml http://www.netframeworkdev.com/windows-presentation-foundation-wpf/contextsensitive-help-in-wpf-73953.shtml

Specifically, you can accomplish this using the System.Windows.Forms.Help.ShowHelp( ) command. 具体来说,您可以使用System.Windows.Forms.Help.ShowHelp( )命令完成此操作。

You may need to add a reference to System.Windows.Forms.dll to access the Help functions. 您可能需要添加对System.Windows.Forms.dll的引用以访问帮助功能。

Finally, if you're still lost on using Help files, all the info you need should be right here: http://msdn.microsoft.com/en-us/library/2ksk25ts.aspx This is all for Windows Forms, of course, but it should carry over to WPF if you have the correct references. 最后,如果你仍然迷失在使用帮助文件,你需要的所有信息应该就在这里: http//msdn.microsoft.com/en-us/library/2ksk25ts.aspx这是所有Windows窗体,当然,如果你有正确的参考,它应该转移到WPF。

You have to add "System.Windows.Forms" reference to your project and then call Help.ShowHelp method to open a specific page in "xyz.chm" 您必须向项目添加“System.Windows.Forms”引用,然后调用Help.ShowHelp方法在“xyz.chm”中打开特定页面

System.Windows.Forms.Help.ShowHelp(null, "xyz.chm","xyz_index.html");

Hope this helps :) 希望这可以帮助 :)

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM