如何打开一个chm文件? [英] How to open a chm file?

查看:92
本文介绍了如何打开一个chm文件?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

大家好,



我正在构建一个应用程序。我有一个位于Debug文件夹中的chm文件。我希望用我的表格在同一个窗口中显示它。



你能解释一下如何做到这一点吗?我使用网络浏览器打开它,但它在另一个窗口打开。



谢谢!

Hi all,

I am building a application. I have a chm file located in Debug folder. I want to display it in the same windows with my Form.

Can you explain how to do that? I use web browser to open it but it opened in another windows.

Thanks!

推荐答案

In Windows表单System.Windows.Forms中的帮助类库提供了'ShowHelp方法,可以在 [1] 中选择容器控件/表单,轻松显示.chm文件:
In Windows Forms the Help Class Library in System.Windows.Forms provides the 'ShowHelp method which makes it easy to display a .chm file in [1] the ContainerControl/Form of your choice:
private void btnShowCHMFile_Click(object sender, EventArgs e)
{
    Help.ShowHelp(pnlCHMHost, @"file:C:\Program Files (x86)\Internet Download Manager\scheduler.chm");
}

这是一个可以在指定面板的 [1] 中打开指定.chm文件的工作代码。



参考:[ ^ ]。



[1] 好吧,它并没有真正打开容器控件中的.chm文件,正如你所料在Windows窗体中:它不会将Control添加到其指定目标容器的ControlsCollection中,并且它不会为您提供对chm viewer窗口的任何有效引用,以便您可以重新调整它的大小等。它会创建一个完整的成熟的窗口,可以移动,可以移动到指定的'父容器的边界之外而不会被剪裁。

This is working code that will open the specified .chm file in [1] a specified Panel.

Reference: [^].

[1]Well, it doesn't really open the .chm file "in" a container control as you might expect in Windows Forms: it doesn't add a Control to the ControlsCollection of its specified target container, and it doesn't give you any valid reference to the chm viewer's window so that you could re-size it, etc. It creates a full-fledged Window, which is movable, and can be moved outside the boundaries of its specified 'Parent container without being clipped.


这篇关于如何打开一个chm文件?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆