将资源文件显示为帮助 [英] displaying resource file as Help

查看:49
本文介绍了将资源文件显示为帮助的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

您好,

我有一个帮助文件作为chm,它作为

资源添加到项目中。我正试图将它显示为

System.Windows.Forms.Help.ShowHelp(我,Name_Of_Helpfile_Resource)

显然不起作用(它不能在那个URL找到任何东西。)

有没有办法做到这一点?

解决方案

你想要的在我看来,将这些文件从项目中删除。


''Visual Basic

''此方法从客户端应用程序中获取允许
''显示帮助时指定的开发人员。

Public Sub DisplayHelp(ByVal parent as System.Windows.Forms.Control,_

ByVal主题为MyHelpEnum)

''要显示的文件由主题

''参数的值选择。

选择案例主题

Case MyHelpEnum.enumWidgets

Windows.Forms.Help.ShowHelp(parent," C:\Help\Widgets.chm")

Case MyHelpEnum.enumMechanisms

'插入代码以实现其他功能。

结束选择

结束子


< lo ******** *@gmail.com在留言中写道

新闻:11 ********************** @ 79g2000cws.googlegro ups.com ...


你好,

我有一个帮助文件作为chm,它被添加到项目中作为

资源。我正试图将它显示为

System.Windows.Forms.Help.ShowHelp(我,Name_Of_Helpfile_Resource)

显然不起作用(它不能在那个URL找到任何东西。)

有没有办法做到这一点?





vbnetdev写道:


我想在你看来将这些文件留在你的项目之外。



是的,我认为你可能是对的,我尝试了很多技巧,

,而且没有一个真的很好用......

好​​的这是下一个问题:如果我不能将chm包含在

项目资源中,我怎样才能确保文件系统中的位置

将是安装在?最好的地方,我认为只需将它安装在与可执行文件相同的位置即可。
。我以为我可以通过应用程序文件(在项目设置 - 发布中)添加它

,但是我不能用
。该程序正在通过ClickOnce进行部署,我无法确定如何控制文件的安装位置。


是的,在这种情况下将它们放在你的bin文件夹中并使用
application.startupPath占位符来验证你的内容是否被正确拾取

。无论安装在哪里,他们都会找到它。


现在你在安装项目中问我如何强制安装到

某个路径?


< lo ********* @ gmail.com写信息

新闻:11 ******** *************@h40g2000cwb.googlegro ups.com ...


>

vbnetdev写道:


>我想在你看来将这些文件留在你的项目之外。



是的,我认为你可能是正确的,我已经尝试了一些技巧,

并且没有一个真的运作良好......

好​​的,所以这里''下一个问题:如果我不能将chm包含在

项目资源中,我怎样才能确保文件系统中将安装

的位置?最好的地方,我认为只需将它安装在与可执行文件相同的位置即可。
。我以为我可以通过应用程序文件(在项目设置 - 发布中)添加它

,但是我不能用
。该程序正在通过ClickOnce进行部署,我无法看到如何控制文件的安装位置。



Hello,
I have a help file as a chm, which is added to the project as a
resource. I''m trying to display it as
System.Windows.Forms.Help.ShowHelp(Me, "Name_Of_Helpfile_Resource")
which obviously does not work (It cannot find anything at that URL).
Is there a way to do this?

解决方案

You want to leave these files out of your project in my opinion.

'' Visual Basic
'' This method takes parameters from the client application that allow
'' the developer to specify when Help is displayed.
Public Sub DisplayHelp (ByVal parent as System.Windows.Forms.Control, _
ByVal topic as MyHelpEnum)
'' The file to display is chosen by the value of the topic
'' parameter.
Select Case topic
Case MyHelpEnum.enumWidgets
Windows.Forms.Help.ShowHelp(parent, "C:\Help\Widgets.chm")
Case MyHelpEnum.enumMechanisms
'' Insert code to implement additional functionality.
End Select
End Sub

<lo*********@gmail.comwrote in message
news:11**********************@79g2000cws.googlegro ups.com...

Hello,
I have a help file as a chm, which is added to the project as a
resource. I''m trying to display it as
System.Windows.Forms.Help.ShowHelp(Me, "Name_Of_Helpfile_Resource")
which obviously does not work (It cannot find anything at that URL).
Is there a way to do this?




vbnetdev wrote:

You want to leave these files out of your project in my opinion.

Yeah I think you may be right about that I''ve tried a number of tricks,
and none of them really worked well...
Ok so here''s the next problem: if I can''t include the chm in the
project resources, how can I ensure the location in the filesystem that
will be installed at? The best place, I think would to just install it
in the same location as the executable file. I thought I could add it
through the Application Files (in "Project Settings -Publish"), but I
can''t. The program is being deployed throught ClickOnce, and I can''t
seem to find much on how to control the install locations of files.


Yes in that case place them in your bin folder and use teh
application.startupPath placeholder to verify your contents are picked up
correctly. Whereever it is installed, here they will find it.

Now are you asking me in the setup project of how to force a install to a
certain path?

<lo*********@gmail.comwrote in message
news:11*********************@h40g2000cwb.googlegro ups.com...

>
vbnetdev wrote:

>You want to leave these files out of your project in my opinion.

Yeah I think you may be right about that I''ve tried a number of tricks,
and none of them really worked well...
Ok so here''s the next problem: if I can''t include the chm in the
project resources, how can I ensure the location in the filesystem that
will be installed at? The best place, I think would to just install it
in the same location as the executable file. I thought I could add it
through the Application Files (in "Project Settings -Publish"), but I
can''t. The program is being deployed throught ClickOnce, and I can''t
seem to find much on how to control the install locations of files.



这篇关于将资源文件显示为帮助的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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